mirror of
https://github.com/krille-chan/fluffychat
synced 2024-08-11 07:13:44 +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!',
|
||||
);
|
||||
}
|
||||
final success = await showFutureLoadingDialog(
|
||||
await showFutureLoadingDialog(
|
||||
context: context,
|
||||
future: () async {
|
||||
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);
|
||||
},
|
||||
future: () => room.invite(userId),
|
||||
);
|
||||
final roomId = success.result;
|
||||
if (roomId == null) return;
|
||||
context.go('/rooms/$roomId');
|
||||
}
|
||||
|
||||
void leaveChat() async {
|
||||
|
|
Loading…
Reference in a new issue