fix confirm conflicts shortcuts

This commit is contained in:
Yurii
2026-01-09 14:54:03 +02:00
parent a52b383ff4
commit 7b35a69106
2 changed files with 20 additions and 0 deletions
@@ -27,6 +27,7 @@
************************************************************************/
import {register} from 'di';
import Ui from 'ui';
/** @typedef {import('view').default} View */
/** @typedef {string|function(KeyboardEvent): void} Key */
@@ -116,6 +117,10 @@ export default class ShortcutManager {
return;
}
if (Ui.getConfirmCount()) {
return;
}
const key = Espo.Utils.getKeyFromKeyEvent(event);
for (const item of items) {
+15
View File
@@ -981,6 +981,8 @@ Espo.Ui = {
message = Handlebars.Utils.escapeExpression(message);
}
confirmCount ++;
return new Promise(resolve => {
const dialog = new Dialog({
backdrop: backdrop,
@@ -1025,6 +1027,8 @@ Espo.Ui = {
}
],
onClose: () => {
confirmCount --;
if (isResolved) {
return;
}
@@ -1366,8 +1370,19 @@ Espo.Ui = {
info: function (message, options) {
Espo.Ui.notify(message, 'info', 2000, options);
},
/**
* Get the number of opened confirmation dialogues.
*
* @return {number}
* @internal
*/
getConfirmCount() {
return confirmCount;
}
};
let confirmCount = 0;
let notifySuppressed = false;
/**