Fix an issue where query tool is stuck when running query after discarding changed data. #5955

This commit is contained in:
Aditya Toshniwal
2023-03-16 17:23:57 +05:30
committed by GitHub
parent 42ac0d577d
commit 3ce1589681
2 changed files with 8 additions and 8 deletions

View File

@@ -819,18 +819,22 @@ export function ResultSet() {
);
};
const executeAndPoll = async ()=>{
let goForPoll = await yesCallback();
if (goForPoll) pollCallback();
};
if(isDataChanged()) {
queryToolCtx.modal.confirm(
gettext('Unsaved changes'),
gettext('The data has been modified, but not saved. Are you sure you wish to discard the changes?'),
yesCallback,
executeAndPoll,
function() {
eventBus.fireEvent(QUERY_TOOL_EVENTS.EXECUTION_END);
}
);
} else {
let goForPoll = await yesCallback();
if (goForPoll) pollCallback();
await executeAndPoll();
}
};