fix: environments being cringe :)
This commit is contained in:
@@ -141,17 +141,14 @@ export function initEnvironments() {
|
||||
.doc(user.uid)
|
||||
.collection("globalEnv")
|
||||
.onSnapshot((globalsRef) => {
|
||||
const variables: any[] = []
|
||||
|
||||
globalsRef.forEach((doc) => {
|
||||
const variable = doc.data()
|
||||
variable.id = doc.id
|
||||
|
||||
variables.push(variable)
|
||||
})
|
||||
if (globalsRef.docs.length === 0) {
|
||||
loadedGlobals = true
|
||||
return
|
||||
}
|
||||
|
||||
const doc = globalsRef.docs[0].data()
|
||||
loadedGlobals = false
|
||||
setGlobalEnvVariables(variables)
|
||||
setGlobalEnvVariables(doc.variables)
|
||||
loadedGlobals = true
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user