fixed double dialog

This commit is contained in:
nikita_bartoshuk
2025-10-09 00:22:18 +03:00
parent d70b5729db
commit 8a5f5c14bc

View File

@ -58,6 +58,7 @@ define([
onLaunch: function () {
this._state = {};
this.redactionsWarningVisible = null;
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
Common.NotificationCenter.on('document:ready', _.bind(this.onDocumentReady, this));
@ -190,7 +191,8 @@ define([
Common.UI.TooltipManager.closeTip('mark-for-redaction');
Common.UI.TooltipManager.closeTip('apply-redaction');
const isMarked = this.api.HasRedact();
if (isMarked) {
if (isMarked && !this.redactionsWarningVisible) {
this.redactionsWarningVisible = true;
Common.UI.warning({
width: 500,
msg: this.textUnappliedRedactions,
@ -207,16 +209,19 @@ define([
this.api.ApplyRedact();
this.api.SetRedactTool(false);
this.view.btnMarkForRedact.toggle(false);
this.redactionsWarningVisible = false;
} else if (btn == 'doNotApply') {
this.api.RemoveAllRedact();
this.api.SetRedactTool(false);
this.view.btnMarkForRedact.toggle(false);
this.redactionsWarningVisible = false;
} else if (btn == 'cancel') {
if (this.mode.isPDFEdit) {
this.toolbar.toolbar.setTab('red')
} else {
Common.NotificationCenter.trigger('pdf:mode-apply', 'edit', 'red');
}
this.redactionsWarningVisible = false;
}
}, this)
});