mirror of
https://github.com/wavetermdev/waveterm.git
synced 2024-12-21 16:38:23 +01:00
only pop modal when purging is successful
This commit is contained in:
parent
09c4a42557
commit
7e128c791b
@ -440,8 +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());
|
||||||
GlobalModel.modalsModel.popModal();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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(() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user