When deleting multiple messages, inform the user of the number

taken from #2263 by @ianmacd
pull/2270/head
Audric Ackermann 3 years ago
parent bfb33d14c5
commit b93201fbe6
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -94,7 +94,7 @@
"messageDeletionForbidden": "You dont have permission to delete others messages",
"deleteJustForMe": "Delete just for me",
"deleteForEveryone": "Delete for everyone",
"deleteMessagesQuestion": "Delete those messages?",
"deleteMessagesQuestion": "Delete $count$ messages?",
"deleteMessageQuestion": "Delete this message?",
"deleteMessages": "Delete Messages",
"deleted": "Deleted",

@ -91,7 +91,7 @@
.selection-mode {
.messages-container > *:not(.message-selected) {
animation: toShadow $session-transition-duration;
opacity: 0.40;
opacity: 0.4;
}
}
}

@ -336,13 +336,14 @@ export async function deleteMessagesByIdForEveryone(
await Promise.all(messageIds.map(m => getMessageById(m, false)))
);
const moreThanOne = selectedMessages.length > 1;
const messageCount = selectedMessages.length;
const moreThanOne = messageCount > 1;
window.inboxStore?.dispatch(
updateConfirmModal({
title: window.i18n('deleteForEveryone'),
message: moreThanOne
? window.i18n('deleteMessagesQuestion')
? window.i18n('deleteMessagesQuestion', [messageCount.toString()])
: window.i18n('deleteMessageQuestion'),
okText: window.i18n('deleteForEveryone'),
okTheme: SessionButtonColor.Danger,

Loading…
Cancel
Save