mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-14 04:15:57 +08:00
refactor: added check for dashboard length (#2997)
Co-authored-by: Palash Gupta <palashgdev@gmail.com>
This commit is contained in:
parent
e3e0787459
commit
c0d10f0d88
@ -7,6 +7,7 @@ export const getDashboardVariables = (): Record<string, unknown> => {
|
|||||||
globalTime,
|
globalTime,
|
||||||
dashboards: { dashboards },
|
dashboards: { dashboards },
|
||||||
} = store.getState();
|
} = store.getState();
|
||||||
|
if (dashboards.length > 0) {
|
||||||
const [selectedDashboard] = dashboards || [];
|
const [selectedDashboard] = dashboards || [];
|
||||||
const {
|
const {
|
||||||
data: { variables = {} },
|
data: { variables = {} },
|
||||||
@ -25,6 +26,8 @@ export const getDashboardVariables = (): Record<string, unknown> => {
|
|||||||
variablesTuple[key] = variables[key].selectedValue;
|
variablesTuple[key] = variables[key].selectedValue;
|
||||||
});
|
});
|
||||||
return variablesTuple;
|
return variablesTuple;
|
||||||
|
}
|
||||||
|
return {};
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user