fix: no lazy translation on SupersetError (#15669)

* fix: no lazy translation on SupersetError

* Small fixes
This commit is contained in:
Beto Dealmeida
2021-07-14 16:54:11 -07:00
committed by GitHub
parent 22494b642e
commit b489cffb57
3 changed files with 29 additions and 19 deletions

View File

@@ -250,18 +250,22 @@ export function queryFailed(query, msg, link, errors) {
})
: Promise.resolve();
return sync
.then(() => dispatch({ type: QUERY_FAILED, query, msg, link, errors }))
.catch(() =>
dispatch(
addDangerToast(
t(
'An error occurred while storing the latest query id in the backend. ' +
'Please contact your administrator if this problem persists.',
return (
sync
.catch(() =>
dispatch(
addDangerToast(
t(
'An error occurred while storing the latest query id in the backend. ' +
'Please contact your administrator if this problem persists.',
),
),
),
),
);
)
// We should always show the error message, even if we couldn't sync the
// state to the backend
.then(() => dispatch({ type: QUERY_FAILED, query, msg, link, errors }))
);
};
}