From af59e57fc03f0bb5b5908510ad5da8ad11a601d9 Mon Sep 17 00:00:00 2001 From: Hivert Quentin Date: Wed, 14 Jun 2023 17:47:23 +0200 Subject: [PATCH] fix(mail): Fix a bug when pressing the key DEL more than once to delete mails --- UI/WebServerResources/js/Mailer/MessageController.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/UI/WebServerResources/js/Mailer/MessageController.js b/UI/WebServerResources/js/Mailer/MessageController.js index ad1fa6452..c652730d8 100644 --- a/UI/WebServerResources/js/Mailer/MessageController.js +++ b/UI/WebServerResources/js/Mailer/MessageController.js @@ -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;