FIX - HUB PERMISSIONS: poll visible runtime session

This commit is contained in:
DCCONSTRUCTIONS 2026-05-14 14:52:06 +03:00
parent dc5f36e5f4
commit 5e18a7f3c2
1 changed files with 14 additions and 0 deletions

View File

@ -456,6 +456,20 @@ export function LauncherApp() {
}; };
}, [authSession?.authenticated, refreshRuntimeState]); }, [authSession?.authenticated, refreshRuntimeState]);
useEffect(() => {
if (!authSession?.authenticated) return;
const intervalId = window.setInterval(() => {
if (document.visibilityState === "visible") {
void refreshRuntimeState();
}
}, 5000);
return () => {
window.clearInterval(intervalId);
};
}, [authSession?.authenticated, refreshRuntimeState]);
function handleProfileChange(userId: string) { function handleProfileChange(userId: string) {
const profile = profileOptions.find((option) => option.userId === userId); const profile = profileOptions.find((option) => option.userId === userId);
setActiveProfileId(userId); setActiveProfileId(userId);