fix: stop endless loading when dataset no longer exist (#16511)

* initial fix

* add const

* add translate
This commit is contained in:
Phillip Kelley-Dotson 2021-08-30 16:42:02 -07:00 committed by GitHub
parent 2199f65373
commit 960d1e4d5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -68,6 +68,9 @@ const propTypes = {
};
const BLANK = {};
const NONEXISTENT_DATASET = t(
'The dataset associated with this chart no longer exists',
);
const defaultProps = {
addFilter: () => BLANK,
@ -178,7 +181,11 @@ class Chart extends React.PureComponent {
const message = chartAlert || queryResponse?.message;
// if datasource is still loading, don't render JS errors
if (chartAlert && datasource === PLACEHOLDER_DATASOURCE) {
if (
chartAlert !== undefined &&
chartAlert !== NONEXISTENT_DATASET &&
datasource === PLACEHOLDER_DATASOURCE
) {
return (
<Styles
data-ui-anchor="chart"