From 7f34516a520dba6a20b1bfa11237c5f45e2c39f1 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Thu, 21 Mar 2024 14:02:08 -0300 Subject: [PATCH] Change key to name --- src/frontend/src/stores/globalVariables.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/frontend/src/stores/globalVariables.ts b/src/frontend/src/stores/globalVariables.ts index 5e9adeecb..e3b8cc734 100644 --- a/src/frontend/src/stores/globalVariables.ts +++ b/src/frontend/src/stores/globalVariables.ts @@ -11,24 +11,24 @@ export const useGlobalVariablesStore = create( globalVariablesEntries: Object.keys(variables), }); }, - addGlobalVariable: (key, id, provider) => { + addGlobalVariable: (name, id, provider) => { const data = { id, provider }; - const newVariables = { ...get().globalVariables, [key]: data }; + const newVariables = { ...get().globalVariables, [name]: data }; set({ globalVariables: newVariables, globalVariablesEntries: Object.keys(newVariables), }); }, - removeGlobalVariable: (key) => { + removeGlobalVariable: (name) => { const newVariables = { ...get().globalVariables }; - delete newVariables[key]; + delete newVariables[name]; set({ globalVariables: newVariables, globalVariablesEntries: Object.keys(newVariables), }); }, - getVariableId: (key) => { - return get().globalVariables[key]?.id; - } + getVariableId: (name) => { + return get().globalVariables[name]?.id; + }, }) );