From 26c637135a932bc02e0f419d5f9c873218898a92 Mon Sep 17 00:00:00 2001 From: Krille Date: Fri, 22 Dec 2023 12:45:49 +0100 Subject: [PATCH] refactor: Reinvite other part instead of reopen dm --- lib/pages/chat/chat.dart | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/lib/pages/chat/chat.dart b/lib/pages/chat/chat.dart index 44965d5c..c0c76c54 100644 --- a/lib/pages/chat/chat.dart +++ b/lib/pages/chat/chat.dart @@ -201,20 +201,10 @@ class ChatController extends State { '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 {