From f909f5d5b7ac71ff2d2929042379da48b97d7ac2 Mon Sep 17 00:00:00 2001 From: William Grant Date: Thu, 15 Jun 2023 17:01:17 +1000 Subject: [PATCH] fix: close SessionConfirm modal as soon as user confirms that they want to leave a conversation --- ts/interactions/conversationInteractions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ts/interactions/conversationInteractions.ts b/ts/interactions/conversationInteractions.ts index 901fbeffd..aaf34a1f0 100644 --- a/ts/interactions/conversationInteractions.ts +++ b/ts/interactions/conversationInteractions.ts @@ -259,11 +259,11 @@ export function showLeavePrivateConversationbyConvoId( type: isMe ? ConversationInteractionType.Hide : ConversationInteractionType.Leave, status: ConversationInteractionStatus.Start, }); + onClickClose(); await getConversationController().delete1o1(conversationId, { fromSyncMessage: false, justHidePrivate: isMe, }); - onClickClose(); await clearConversationInteractionState({ conversationId }); } catch (err) { window.log.warn(`showLeavePrivateConversationbyConvoId error: ${err}`); @@ -317,6 +317,7 @@ export function showLeaveGroupByConvoId(conversationId: string, name: string | u type: ConversationInteractionType.Leave, status: ConversationInteractionStatus.Start, }); + onClickClose(); if (isPublic) { await getConversationController().deleteCommunity(conversation.id, { fromSyncMessage: false, @@ -327,7 +328,6 @@ export function showLeaveGroupByConvoId(conversationId: string, name: string | u sendLeaveMessage: true, }); } - onClickClose(); await clearConversationInteractionState({ conversationId }); } catch (err) { window.log.warn(`showLeaveGroupByConvoId error: ${err}`);