mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Dont parse empty explore state from url
- only parse url state if there is any - prevents parse exception in the console on empty explore state
This commit is contained in:
parent
a1f0dffe01
commit
f67b27e009
@ -31,7 +31,8 @@ function makeTimeSeriesList(dataList, options) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseInitialState(initial) {
|
function parseInitialState(initial: string | undefined) {
|
||||||
|
if (initial) {
|
||||||
try {
|
try {
|
||||||
const parsed = JSON.parse(decodePathComponent(initial));
|
const parsed = JSON.parse(decodePathComponent(initial));
|
||||||
return {
|
return {
|
||||||
@ -41,9 +42,10 @@ function parseInitialState(initial) {
|
|||||||
};
|
};
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
return { queries: [], range: DEFAULT_RANGE };
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return { datasource: null, queries: [], range: DEFAULT_RANGE };
|
||||||
|
}
|
||||||
|
|
||||||
interface IExploreState {
|
interface IExploreState {
|
||||||
datasource: any;
|
datasource: any;
|
||||||
|
Loading…
Reference in New Issue
Block a user