From cf60055c77ff68cde6059d8172592191a4ac4e10 Mon Sep 17 00:00:00 2001 From: Fred Sauer Date: Sun, 1 Mar 2026 12:48:34 -0800 Subject: [PATCH] prevent stacking alerts: no more undo/redo --- src/ide/windows.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ide/windows.ts b/src/ide/windows.ts index b19ab2ca..87d834a3 100644 --- a/src/ide/windows.ts +++ b/src/ide/windows.ts @@ -22,6 +22,7 @@ export class ProjectWindows { undofiles: string[]; redofiles: string[]; titlePrefix: string; + alerting: boolean; constructor(containerdiv: HTMLElement, project: CodeProject) { this.containerdiv = containerdiv; @@ -171,7 +172,7 @@ export class ProjectWindows { this.redofiles.push(fileid); this.refresh(false); } else { - bootbox.alert("No more steps to undo."); + this.showAlert("No more steps to undo."); } } @@ -183,10 +184,16 @@ export class ProjectWindows { this.undofiles.push(fileid); this.refresh(false); } else { - bootbox.alert("No more steps to redo."); + this.showAlert("No more steps to redo."); } } + showAlert(msg: string) { + if (this.alerting) return; + this.alerting = true; + bootbox.alert(msg, () => { this.alerting = false; }); + } + updateAllOpenWindows(store) { for (var fileid in this.id2window) { var wnd = this.id2window[fileid];