FIX - HUB PERMISSIONS: refresh admin downgrade live
This commit is contained in:
parent
712e9224c0
commit
dc5f36e5f4
|
|
@ -375,6 +375,13 @@ export function LauncherApp() {
|
|||
void refreshTaskManagerWorkspaces();
|
||||
}, [adminOpen, canOpenAdminApi]);
|
||||
|
||||
useEffect(() => {
|
||||
if (runtimeMe.permissions.canOpenAdmin) return;
|
||||
|
||||
setAdminOpen(false);
|
||||
setAdminMode("admin");
|
||||
}, [runtimeMe.permissions.canOpenAdmin]);
|
||||
|
||||
const refreshRuntimeState = useCallback(async () => {
|
||||
try {
|
||||
const nextSession = await fetchAuthSession();
|
||||
|
|
@ -386,18 +393,8 @@ export function LauncherApp() {
|
|||
return;
|
||||
}
|
||||
|
||||
const currentData = runtimeDataRef.current;
|
||||
const nextContext = resolveAuthenticatedContext(
|
||||
currentData,
|
||||
nextSession,
|
||||
runtimeProfileIdRef.current,
|
||||
runtimeClientIdRef.current
|
||||
);
|
||||
const nextMe = buildMe(currentData, nextContext.profileId, nextContext.clientId);
|
||||
const [persistedData, apps] = await Promise.all([
|
||||
nextSession.isSuperAdmin || nextMe.permissions.canOpenAdmin
|
||||
? fetchControlPlaneSnapshot().then((snapshot) => snapshot.data)
|
||||
: loadPersistedLauncherData(),
|
||||
loadPersistedLauncherData(),
|
||||
fetchAvailableApps(),
|
||||
]);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue