Remove timeouts

This commit is contained in:
Christian Pauly 2020-05-05 15:32:15 +02:00
parent e02a8d294e
commit 24225ee83e
1 changed files with 3 additions and 10 deletions

View File

@ -120,19 +120,13 @@ abstract class FirebaseController {
client = Client(clientName, debug: false); client = Client(clientName, debug: false);
client.storeAPI = ExtendedStore(client); client.storeAPI = ExtendedStore(client);
await client.onLoginStateChanged.stream await client.onLoginStateChanged.stream
.firstWhere((l) => l == LoginState.logged) .firstWhere((l) => l == LoginState.logged);
.timeout(
Duration(seconds: 2),
);
} }
// Get the room // Get the room
Room room = client.getRoomById(roomId); Room room = client.getRoomById(roomId);
if (room == null) { if (room == null) {
await client.onRoomUpdate.stream await client.onRoomUpdate.stream.where((u) => u.id == roomId).first;
.where((u) => u.id == roomId)
.first
.timeout(Duration(seconds: 5));
room = client.getRoomById(roomId); room = client.getRoomById(roomId);
if (room == null) return null; if (room == null) return null;
} }
@ -142,8 +136,7 @@ abstract class FirebaseController {
if (event == null) { if (event == null) {
final EventUpdate eventUpdate = await client.onEvent.stream final EventUpdate eventUpdate = await client.onEvent.stream
.where((u) => u.content["event_id"] == eventId) .where((u) => u.content["event_id"] == eventId)
.first .first;
.timeout(Duration(seconds: 5));
event = Event.fromJson(eventUpdate.content, room); event = Event.fromJson(eventUpdate.content, room);
if (room == null) return null; if (room == null) return null;
} }