Remove timeouts
This commit is contained in:
parent
e02a8d294e
commit
24225ee83e
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue