fix(persistence-service): update global environment variables schema (#3829)

This commit is contained in:
James George
2024-02-15 21:40:31 +05:30
committed by GitHub
parent fc34871dae
commit dfdd44b4ed
2 changed files with 18 additions and 34 deletions

View File

@@ -628,7 +628,7 @@ export class PersistenceService extends Service {
private setupGlobalEnvsPersistence() {
const globalEnvKey = "globalEnv"
let globalEnvData: Environment["variables"] = JSON.parse(
let globalEnvData: z.infer<typeof GLOBAL_ENV_SCHEMA> = JSON.parse(
window.localStorage.getItem(globalEnvKey) || "[]"
)
@@ -644,7 +644,7 @@ export class PersistenceService extends Service {
)
}
setGlobalEnvVariables(globalEnvData)
setGlobalEnvVariables(globalEnvData as Environment["variables"])
globalEnv$.subscribe((vars) => {
window.localStorage.setItem(globalEnvKey, JSON.stringify(vars))