mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-02-07 00:12:21 +01:00
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:
parent
de9c029ba8
commit
019eaecdaa
@ -440,7 +440,7 @@ class SessionSettingsModal extends React.Component<{}, {}> {
|
||||
return;
|
||||
}
|
||||
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-label">Check for Updates</div>
|
||||
<div className="settings-input">
|
||||
<Toggle checked={!cdata.clientopts.noreleasecheck} onChange={this.handleChangeReleaseCheck} />
|
||||
<Toggle
|
||||
checked={!cdata.clientopts.noreleasecheck}
|
||||
onChange={this.handleChangeReleaseCheck}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="settings-field">
|
||||
|
@ -390,9 +390,12 @@ function getColorRGB(colorInput) {
|
||||
return computedColorStyle;
|
||||
}
|
||||
|
||||
function commandRtnHandler(prtn: Promise<CommandRtnType>, errorMessage: OV<string>) {
|
||||
function commandRtnHandler(prtn: Promise<CommandRtnType>, errorMessage: OV<string>, onSuccess?: () => void) {
|
||||
prtn.then((crtn) => {
|
||||
if (crtn.success) {
|
||||
if (onSuccess) {
|
||||
onSuccess();
|
||||
}
|
||||
return;
|
||||
}
|
||||
mobx.action(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user