fix(sqllab): Close already removed tab (#27391)

This commit is contained in:
JUST.in DO IT
2024-03-06 08:59:56 -08:00
committed by GitHub
parent 66bf70172f
commit 5107cc0fd9
4 changed files with 90 additions and 13 deletions

View File

@@ -743,15 +743,18 @@ export function removeQueryEditor(queryEditor) {
return sync
.then(() => dispatch({ type: REMOVE_QUERY_EDITOR, queryEditor }))
.catch(() =>
dispatch(
addDangerToast(
t(
'An error occurred while removing tab. Please contact your administrator.',
.catch(({ status }) => {
if (status !== 404) {
return dispatch(
addDangerToast(
t(
'An error occurred while removing tab. Please contact your administrator.',
),
),
),
),
);
);
}
return dispatch({ type: REMOVE_QUERY_EDITOR, queryEditor });
});
};
}