diff --git a/web/ui/react-app/src/pages/PanelList.tsx b/web/ui/react-app/src/pages/PanelList.tsx index d7aa69dc4a..c72fd8239c 100644 --- a/web/ui/react-app/src/pages/PanelList.tsx +++ b/web/ui/react-app/src/pages/PanelList.tsx @@ -20,29 +20,21 @@ interface PanelListState { timeDriftError: string | null; } -const initialPanel = { - id: generateID(), - key: '0', - options: PanelDefaultOptions, -}; - class PanelList extends Component { constructor(props: PathPrefixProps) { super(props); - const urlPanels = decodePanelOptionsFromQueryString(window.location.search); - this.state = { - panels: urlPanels.length ? urlPanels : [initialPanel], + panels: decodePanelOptionsFromQueryString(window.location.search), pastQueries: [], metricNames: [], fetchMetricsError: null, timeDriftError: null, }; - !urlPanels.length && this.updateURL(); } componentDidMount() { + !this.state.panels.length && this.addPanel() fetch(`${this.props.pathPrefix}/api/v1/label/__name__/values`, { cache: 'no-store' }) .then(resp => { if (resp.ok) {