remove clearmodals mothed as it's no longer needed

This commit is contained in:
Red Adaya 2024-03-12 09:03:46 +08:00
parent 5258a67a78
commit f850e3b728

View File

@ -337,7 +337,6 @@ class Model {
cancelAlert(): void { cancelAlert(): void {
mobx.action(() => { mobx.action(() => {
this.alertMessage.set(null); this.alertMessage.set(null);
this.modalsModel.popModal();
})(); })();
if (this.alertPromiseResolver != null) { if (this.alertPromiseResolver != null) {
this.alertPromiseResolver(false); this.alertPromiseResolver(false);
@ -484,15 +483,13 @@ class Model {
this.historyViewModel.handleDocKeyDown(e); this.historyViewModel.handleDocKeyDown(e);
return; return;
} }
if (checkKeyPressed(waveEvent, "Escape")) { if (checkKeyPressed(waveEvent, "Escape")) {
e.preventDefault(); e.preventDefault();
if (this.activeMainView.get() == "webshare") { if (this.activeMainView.get() == "webshare") {
this.showSessionView(); this.showSessionView();
return; return;
} }
if (this.clearModals()) {
return;
}
const inputModel = this.inputModel; const inputModel = this.inputModel;
inputModel.toggleInfoMsg(); inputModel.toggleInfoMsg();
if (inputModel.inputMode.get() != null) { if (inputModel.inputMode.get() != null) {
@ -615,33 +612,6 @@ class Model {
return screen.getTermWrap(line.lineid); 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 { restartWaveSrv(): void {
getApi().restartWaveSrv(); getApi().restartWaveSrv();
} }