fix(mail): Fix a bug when pressing the key DEL more than once to delete mails

This commit is contained in:
Hivert Quentin
2023-06-14 17:47:23 +02:00
parent 22372a7598
commit af59e57fc0
@@ -30,6 +30,7 @@
this.$alwaysShowDetailedRecipients = (!stateMessage.to || stateMessage.to.length < 5) && (!stateMessage.cc || stateMessage.cc.length < 5);
this.$showDetailedRecipients = this.$alwaysShowDetailedRecipients;
this.showRawSource = false;
this.mailInDeletion = -1;
_registerHotkeys(hotkeys);
@@ -153,7 +154,8 @@
keys.push(sgHotkeys.createHotkey({
key: hotkey,
callback: _unlessInDialog(function($event) {
if (vm.mailbox.selectedCount() === 0)
if (vm.mailbox.selectedCount() === 0
&& vm.message.uid !== vm.mailInDeletion) //prevent calling function if it was alredy made for this mail
vm.deleteMessage();
$event.preventDefault();
}),
@@ -335,6 +337,7 @@
if (Mailbox.$virtualMode) {
mailbox = Mailbox.selectedFolder; // the VirtualMailbox instance
}
vm.mailInDeletion = message.uid;
function _success(index) {
var nextIndex = index;