Immediately hide modal when deleting workspace (#187)

* immediately hide modal when deleting workspace

* only pop modal when purging is successful
This commit is contained in:
Red J Adaya
2023-12-23 12:31:11 -08:00
committed by GitHub
parent de9c029ba8
commit 019eaecdaa
2 changed files with 9 additions and 3 deletions
+5 -2
View File
@@ -440,7 +440,7 @@ class SessionSettingsModal extends React.Component<{}, {}> {
return; return;
} }
let prtn = GlobalCommandRunner.sessionPurge(this.sessionId); let prtn = GlobalCommandRunner.sessionPurge(this.sessionId);
commandRtnHandler(prtn, this.errorMessage); commandRtnHandler(prtn, this.errorMessage, () => GlobalModel.modalsModel.popModal());
}); });
} }
@@ -783,7 +783,10 @@ class ClientSettingsModal extends React.Component<{}, {}> {
<div className="settings-field"> <div className="settings-field">
<div className="settings-label">Check for Updates</div> <div className="settings-label">Check for Updates</div>
<div className="settings-input"> <div className="settings-input">
<Toggle checked={!cdata.clientopts.noreleasecheck} onChange={this.handleChangeReleaseCheck} /> <Toggle
checked={!cdata.clientopts.noreleasecheck}
onChange={this.handleChangeReleaseCheck}
/>
</div> </div>
</div> </div>
<div className="settings-field"> <div className="settings-field">
+4 -1
View File
@@ -390,9 +390,12 @@ function getColorRGB(colorInput) {
return computedColorStyle; return computedColorStyle;
} }
function commandRtnHandler(prtn: Promise<CommandRtnType>, errorMessage: OV<string>) { function commandRtnHandler(prtn: Promise<CommandRtnType>, errorMessage: OV<string>, onSuccess?: () => void) {
prtn.then((crtn) => { prtn.then((crtn) => {
if (crtn.success) { if (crtn.success) {
if (onSuccess) {
onSuccess();
}
return; return;
} }
mobx.action(() => { mobx.action(() => {