diff --git a/src/app/LauncherApp.tsx b/src/app/LauncherApp.tsx index 9327537..979fead 100644 --- a/src/app/LauncherApp.tsx +++ b/src/app/LauncherApp.tsx @@ -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(), ]);