From ffc4a2af219d200e17bdf3705baccedd586b6074 Mon Sep 17 00:00:00 2001 From: Alex P Date: Wed, 8 Oct 2025 21:42:59 +0300 Subject: [PATCH] fix: prevent getLocalVersion call for sessions without video permission Sessions in pending mode do not have PermissionVideoView and should not attempt to call getLocalVersion RPC method. Add permission check before calling getLocalVersion to prevent unnecessary permission denied errors. --- ui/src/components/AccessDeniedOverlay.tsx | 3 +-- ui/src/routes/devices.$id.tsx | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/src/components/AccessDeniedOverlay.tsx b/ui/src/components/AccessDeniedOverlay.tsx index f9aa6aa5..fd7f6f24 100644 --- a/ui/src/components/AccessDeniedOverlay.tsx +++ b/ui/src/components/AccessDeniedOverlay.tsx @@ -55,8 +55,7 @@ export default function AccessDeniedOverlay({ const newCount = incrementRejectionCount(); if (newCount >= maxRejectionAttempts) { - const hideTimer = setTimeout(() => {}, 3000); - return () => clearTimeout(hideTimer); + return; } const timer = setInterval(() => { diff --git a/ui/src/routes/devices.$id.tsx b/ui/src/routes/devices.$id.tsx index ad16119c..4ab6e80f 100644 --- a/ui/src/routes/devices.$id.tsx +++ b/ui/src/routes/devices.$id.tsx @@ -889,9 +889,10 @@ export default function KvmIdRoute() { useEffect(() => { if (appVersion) return; + if (!hasPermission(Permission.VIDEO_VIEW)) return; getLocalVersion(); - }, [appVersion, getLocalVersion]); + }, [appVersion, getLocalVersion, hasPermission]); const ConnectionStatusElement = useMemo(() => { const hasConnectionFailed =