mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-10 12:25:11 +00:00
refactor: Reinvite other part instead of reopen dm
This commit is contained in:
parent
e2a251b3fe
commit
26c637135a
1 changed files with 2 additions and 12 deletions
|
@ -201,20 +201,10 @@ class ChatController extends State<ChatPageWithRoom> {
|
||||||
'Try to recreate a room with is not a DM room. This should not be possible from the UI!',
|
'Try to recreate a room with is not a DM room. This should not be possible from the UI!',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
final success = await showFutureLoadingDialog(
|
await showFutureLoadingDialog(
|
||||||
context: context,
|
context: context,
|
||||||
future: () async {
|
future: () => room.invite(userId),
|
||||||
final client = room.client;
|
|
||||||
final waitForSync = client.onSync.stream
|
|
||||||
.firstWhere((s) => s.rooms?.leave?.containsKey(room.id) ?? false);
|
|
||||||
await room.leave();
|
|
||||||
await waitForSync;
|
|
||||||
return await client.startDirectChat(userId);
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
final roomId = success.result;
|
|
||||||
if (roomId == null) return;
|
|
||||||
context.go('/rooms/$roomId');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void leaveChat() async {
|
void leaveChat() async {
|
||||||
|
|
Loading…
Reference in a new issue