mirror of
https://github.com/simstudioai/sim.git
synced 2026-09-24 15:45:35 +08:00
fix(secrets): invalidate env queries so dropdown updates without refresh (#4359)
* fix(secrets): invalidate env queries so dropdown updates without refresh * improvement(secrets): use targeted workspaces key for env invalidation
This commit is contained in:
@@ -12,7 +12,8 @@ const logger = createLogger('EnvironmentQueries')
|
||||
export const environmentKeys = {
|
||||
all: ['environment'] as const,
|
||||
personal: () => [...environmentKeys.all, 'personal'] as const,
|
||||
workspace: (workspaceId: string) => [...environmentKeys.all, 'workspace', workspaceId] as const,
|
||||
workspaces: () => [...environmentKeys.all, 'workspace'] as const,
|
||||
workspace: (workspaceId: string) => [...environmentKeys.workspaces(), workspaceId] as const,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -69,6 +70,7 @@ export function useSavePersonalEnvironment() {
|
||||
},
|
||||
onSettled: () => {
|
||||
queryClient.invalidateQueries({ queryKey: environmentKeys.personal() })
|
||||
queryClient.invalidateQueries({ queryKey: environmentKeys.workspaces() })
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user