Commit 5c6adbba by David Committed by GitHub

Merge pull request #12630 from grafana/davkal/explore-empty-error

Dont parse empty explore state from url
parents 05e060de f67b27e0
......@@ -33,7 +33,8 @@ function makeTimeSeriesList(dataList, options) {
});
}
function parseInitialState(initial) {
function parseInitialState(initial: string | undefined) {
if (initial) {
try {
const parsed = JSON.parse(decodePathComponent(initial));
return {
......@@ -43,8 +44,9 @@ function parseInitialState(initial) {
};
} catch (e) {
console.error(e);
return { queries: [], range: DEFAULT_RANGE };
}
}
return { datasource: null, queries: [], range: DEFAULT_RANGE };
}
interface IExploreState {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment