From 5b58a5194bc55874a4cbc40f924d907cbf9118f5 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Wed, 14 Feb 2024 16:02:35 +1100 Subject: [PATCH] fix: make onClickClose on confirmModal mandatory --- ts/components/dialog/SessionConfirm.tsx | 2 +- ts/components/leftpane/overlay/OverlayMessageRequest.tsx | 3 +++ ts/components/settings/section/CategoryPermissions.tsx | 3 +++ ts/interactions/conversations/unsendingInteractions.ts | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ts/components/dialog/SessionConfirm.tsx b/ts/components/dialog/SessionConfirm.tsx index 932a8a66c..550c8439e 100644 --- a/ts/components/dialog/SessionConfirm.tsx +++ b/ts/components/dialog/SessionConfirm.tsx @@ -49,7 +49,7 @@ export interface SessionConfirmDialogProps { */ onClickOk?: (...args: Array) => Promise | void; - onClickClose?: () => any; + onClickClose: () => any; /** * function to run on close click. Closes modal after execution by default diff --git a/ts/components/leftpane/overlay/OverlayMessageRequest.tsx b/ts/components/leftpane/overlay/OverlayMessageRequest.tsx index 65f5b520d..a8afda3e2 100644 --- a/ts/components/leftpane/overlay/OverlayMessageRequest.tsx +++ b/ts/components/leftpane/overlay/OverlayMessageRequest.tsx @@ -87,6 +87,9 @@ export const OverlayMessageRequest = () => { await forceSyncConfigurationNowIfNeeded(); }, + onClickClose: () => { + window.inboxStore?.dispatch(updateConfirmModal(null)); + }, }) ); } diff --git a/ts/components/settings/section/CategoryPermissions.tsx b/ts/components/settings/section/CategoryPermissions.tsx index b749bfcb8..cf55b0065 100644 --- a/ts/components/settings/section/CategoryPermissions.tsx +++ b/ts/components/settings/section/CategoryPermissions.tsx @@ -27,6 +27,9 @@ const toggleCallMediaPermissions = async (triggerUIUpdate: () => void) => { await window.toggleCallMediaPermissionsTo(false); triggerUIUpdate(); }, + onClickClose: () => { + window.inboxStore?.dispatch(updateConfirmModal(null)); + }, }) ); } else { diff --git a/ts/interactions/conversations/unsendingInteractions.ts b/ts/interactions/conversations/unsendingInteractions.ts index c73c77117..f87aea766 100644 --- a/ts/interactions/conversations/unsendingInteractions.ts +++ b/ts/interactions/conversations/unsendingInteractions.ts @@ -364,6 +364,7 @@ export async function deleteMessagesByIdForEveryone( closeDialog(); }, onClickCancel: closeDialog, + onClickClose: closeDialog, closeAfterInput: false, }) );