Skip to content

Commit 908e1ae

Browse files
committed
Refactor
1 parent ca5cf50 commit 908e1ae

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/ide/src/fill/dialog.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,10 @@ export class Dialog {
130130
* Show the dialog.
131131
*/
132132
public show(): void {
133-
if (!this.cachedActiveElement && document.getElementsByClassName(this.overlay.className).length === 0) {
133+
if (document.querySelector(`.${this.overlay.className}`)) {
134+
throw new Error ("Save prompt is already open");
135+
}
136+
if (!this.cachedActiveElement) {
134137
this.cachedActiveElement = document.activeElement as HTMLElement;
135138
(document.querySelector(".monaco-workbench") || document.body).appendChild(this.overlay);
136139
document.addEventListener("keydown", this.onKeydown);

0 commit comments

Comments
 (0)