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

onboarding
Christian Pauly 4 years ago
parent a1f586c655
commit 29a3b4ff02

@ -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;

Loading…
Cancel
Save