diff --git a/src/app/common/modals/alert.tsx b/src/app/common/modals/alert.tsx
index f128f26d..714869ae 100644
--- a/src/app/common/modals/alert.tsx
+++ b/src/app/common/modals/alert.tsx
@@ -44,7 +44,7 @@ class AlertModal extends React.Component<{}, {}> {
{message?.message}
-
+
void) {
mobx.action(() => {
this.store.pop();
})();
+ callback && callback();
}
}
diff --git a/src/models/model.ts b/src/models/model.ts
index a1d0069a..ea0128bc 100644
--- a/src/models/model.ts
+++ b/src/models/model.ts
@@ -357,7 +357,6 @@ class Model {
cancelAlert(): void {
mobx.action(() => {
this.alertMessage.set(null);
- this.modalsModel.popModal();
})();
if (this.alertPromiseResolver != null) {
this.alertPromiseResolver(false);
@@ -478,7 +477,7 @@ class Model {
if (this.alertMessage.get() != null) {
if (checkKeyPressed(waveEvent, "Escape")) {
e.preventDefault();
- this.cancelAlert();
+ this.modalsModel.popModal(() => this.cancelAlert());
return;
}
if (checkKeyPressed(waveEvent, "Enter")) {
@@ -488,6 +487,10 @@ class Model {
}
return;
}
+ if (checkKeyPressed(waveEvent, "Escape") && this.modalsModel.store.length > 0) {
+ this.modalsModel.popModal();
+ return;
+ }
if (this.activeMainView.get() == "bookmarks") {
this.bookmarksModel.handleDocKeyDown(e);
}
@@ -495,10 +498,10 @@ class Model {
this.historyViewModel.handleDocKeyDown(e);
}
if (this.activeMainView.get() == "connections") {
- this.historyViewModel.handleDocKeyDown(e);
+ this.connectionViewModel.handleDocKeyDown(e);
}
if (this.activeMainView.get() == "clientsettings") {
- this.historyViewModel.handleDocKeyDown(e);
+ this.clientSettingsViewModel.handleDocKeyDown(e);
} else {
if (checkKeyPressed(waveEvent, "Escape")) {
e.preventDefault();
@@ -506,9 +509,6 @@ class Model {
this.showSessionView();
return;
}
- if (this.clearModals()) {
- return;
- }
const inputModel = this.inputModel;
inputModel.toggleInfoMsg();
if (inputModel.inputMode.get() != null) {
@@ -628,33 +628,6 @@ class Model {
return screen.getTermWrap(line.lineid);
}
- clearModals(): boolean {
- let didSomething = false;
- mobx.action(() => {
- if (this.screenSettingsModal.get()) {
- this.screenSettingsModal.set(null);
- didSomething = true;
- }
- if (this.sessionSettingsModal.get()) {
- this.sessionSettingsModal.set(null);
- didSomething = true;
- }
- if (this.screenSettingsModal.get()) {
- this.screenSettingsModal.set(null);
- didSomething = true;
- }
- if (this.clientSettingsModal.get()) {
- this.clientSettingsModal.set(false);
- didSomething = true;
- }
- if (this.lineSettingsModal.get()) {
- this.lineSettingsModal.set(null);
- didSomething = true;
- }
- })();
- return didSomething;
- }
-
restartWaveSrv(): void {
getApi().restartWaveSrv();
}