diff --git a/frontend/src/metabase/query_builder/actions/querying.js b/frontend/src/metabase/query_builder/actions/querying.js index e7cb149d928195a4dd4cf2d9a04e84bcf6fece11..dc1637c49490ada80b9e68a754ac669e4a8587cd 100644 --- a/frontend/src/metabase/query_builder/actions/querying.js +++ b/frontend/src/metabase/query_builder/actions/querying.js @@ -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 }; } };