From 1ee3405c7ed82f9edbf20c2d4777f0de2bd6103c Mon Sep 17 00:00:00 2001 From: William Grant Date: Wed, 14 Feb 2024 14:04:30 +1100 Subject: [PATCH] fix: note to self convos cannot delete for everyone so we dont need options in the delete modal --- .../conversations/unsendingInteractions.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ts/interactions/conversations/unsendingInteractions.ts b/ts/interactions/conversations/unsendingInteractions.ts index c73c77117..7310a2fa7 100644 --- a/ts/interactions/conversations/unsendingInteractions.ts +++ b/ts/interactions/conversations/unsendingInteractions.ts @@ -375,6 +375,8 @@ export async function deleteMessagesById(messageIds: Array, conversation await Promise.all(messageIds.map(m => Data.getMessageById(m, false))) ); + const isMe = conversation.isMe(); + const messageCount = selectedMessages.length; const moreThanOne = selectedMessages.length > 1; const closeDialog = () => window.inboxStore?.dispatch(updateConfirmModal(null)); @@ -385,10 +387,12 @@ export async function deleteMessagesById(messageIds: Array, conversation message: moreThanOne ? window.i18n('deleteMessagesQuestion', [messageCount.toString()]) : window.i18n('deleteMessageQuestion'), - radioOptions: [ - { label: window.i18n('deleteJustForMe'), value: 'deleteJustForMe' }, - { label: window.i18n('deleteForEveryone'), value: 'deleteForEveryone' }, - ], + radioOptions: !isMe + ? [ + { label: window.i18n('deleteJustForMe'), value: 'deleteJustForMe' }, + { label: window.i18n('deleteForEveryone'), value: 'deleteForEveryone' }, + ] + : undefined, okText: window.i18n('delete'), okTheme: SessionButtonColor.Danger, onClickOk: async args => {