Skip to content
Snippets Groups Projects
Unverified Commit 271d01eb authored by Gustavo Saiani's avatar Gustavo Saiani Committed by GitHub
Browse files

Update and persist document title when cancelling query run (#22541)

parent 1315aa24
No related merge requests found
......@@ -160,10 +160,19 @@ export const runQuestionQuery = ({
const loadStartUIControls = createThunkAction(
LOAD_START_UI_CONTROLS,
() => (dispatch, getState) => {
dispatch(setDocumentTitle(t`Doing Science...`));
const title = {
onceQueryIsRun: t`Doing Science...`,
ifQueryTakesLong: t`Still Here...`,
};
dispatch(setDocumentTitle(title.onceQueryIsRun));
const timeoutId = setTimeout(() => {
dispatch(setDocumentTitle(t`Still Here...`));
if (document.title.includes(title.onceQueryIsRun)) {
dispatch(setDocumentTitle(title.ifQueryTakesLong));
}
}, 10000);
dispatch(setDocumentTitleTimeoutId(timeoutId));
},
);
......@@ -234,6 +243,8 @@ export const cancelQuery = () => (dispatch, getState) => {
if (cancelQueryDeferred) {
cancelQueryDeferred.resolve();
}
dispatch(setDocumentTitle(""));
return { type: CANCEL_QUERY };
}
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment