FIX - HUB PERMISSIONS: poll visible runtime session
This commit is contained in:
parent
dc5f36e5f4
commit
5e18a7f3c2
|
|
@ -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);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue