mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Merge pull request #12630 from grafana/davkal/explore-empty-error
Dont parse empty explore state from url
This commit is contained in:
commit
5c6adbbada
@ -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,9 +44,10 @@ function parseInitialState(initial) {
|
||||
};
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
return { queries: [], range: DEFAULT_RANGE };
|
||||
}
|
||||
}
|
||||
return { datasource: null, queries: [], range: DEFAULT_RANGE };
|
||||
}
|
||||
|
||||
interface IExploreState {
|
||||
datasource: any;
|
||||
|
Loading…
Reference in New Issue
Block a user