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
1 changed files with 10 additions and 1 deletions

View File

@ -39,7 +39,16 @@ class ChatListItem extends StatelessWidget {
if (!activeChat) {
if (room.membership == Membership.invite &&
(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 !=
null) {
return;