fix: Wait for sync before enter a room a user has got invited

This commit is contained in:
Christian Pauly 2021-08-12 12:33:41 +02:00
parent 51d9a56058
commit a745d3ce68

View File

@ -39,7 +39,16 @@ class ChatListItem extends StatelessWidget {
if (!activeChat) { if (!activeChat) {
if (room.membership == Membership.invite && if (room.membership == Membership.invite &&
(await showFutureLoadingDialog( (await showFutureLoadingDialog(
context: context, future: () => room.join())) context: context,
future: () async {
final joinedFuture = room.client.onRoomUpdate.stream
.where((u) =>
u.id == room.id &&
u.membership == Membership.join)
.first;
await room.join();
await joinedFuture;
}))
.error != .error !=
null) { null) {
return; return;