diff --git a/frontend/src/container/NewDashboard/DashboardVariablesSelection/DashboardVariableSelection.tsx b/frontend/src/container/NewDashboard/DashboardVariablesSelection/DashboardVariableSelection.tsx index 8ced5b2b22..8d67a8250b 100644 --- a/frontend/src/container/NewDashboard/DashboardVariablesSelection/DashboardVariableSelection.tsx +++ b/frontend/src/container/NewDashboard/DashboardVariablesSelection/DashboardVariableSelection.tsx @@ -73,7 +73,7 @@ function DashboardVariableSelection(): JSX.Element | null { return variableCopy; }, ); - updateLocalStorageDashboardVariables(id, value, allSelected); + updateLocalStorageDashboardVariables(name, value, allSelected); const variables = convertVariablesToDbFormat(newVariablesArr); diff --git a/frontend/src/providers/Dashboard/Dashboard.tsx b/frontend/src/providers/Dashboard/Dashboard.tsx index 158374ec3c..a7fa94c044 100644 --- a/frontend/src/providers/Dashboard/Dashboard.tsx +++ b/frontend/src/providers/Dashboard/Dashboard.tsx @@ -116,9 +116,10 @@ export function DashboardProvider({ if (data && localStorageVariables) { const updatedVariables = data.data.variables; Object.keys(data.data.variables).forEach((variable) => { + const variableData = data.data.variables[variable]; const updatedVariable = { ...data.data.variables[variable], - ...localStorageVariables[variable as any], + ...localStorageVariables[variableData.name as any], }; updatedVariables[variable] = updatedVariable;