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;
|
||||
}
|
||||
let prtn = GlobalCommandRunner.sessionPurge(this.sessionId);
|
||||
commandRtnHandler(prtn, this.errorMessage);
|
||||
GlobalModel.modalsModel.popModal();
|
||||
commandRtnHandler(prtn, this.errorMessage, () => GlobalModel.modalsModel.popModal());
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -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