From dc5f36e5f49392c93b3e5ee6385cfb271841c012 Mon Sep 17 00:00:00 2001 From: DCCONSTRUCTIONS Date: Thu, 14 May 2026 14:41:10 +0300 Subject: [PATCH] FIX - HUB PERMISSIONS: refresh admin downgrade live --- src/app/LauncherApp.tsx | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) 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(), ]);