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.
This commit is contained in:
Alex P 2025-10-08 21:42:59 +03:00
parent a1548fe5b1
commit ffc4a2af21
2 changed files with 3 additions and 3 deletions

View File

@ -55,8 +55,7 @@ export default function AccessDeniedOverlay({
const newCount = incrementRejectionCount(); const newCount = incrementRejectionCount();
if (newCount >= maxRejectionAttempts) { if (newCount >= maxRejectionAttempts) {
const hideTimer = setTimeout(() => {}, 3000); return;
return () => clearTimeout(hideTimer);
} }
const timer = setInterval(() => { const timer = setInterval(() => {

View File

@ -889,9 +889,10 @@ export default function KvmIdRoute() {
useEffect(() => { useEffect(() => {
if (appVersion) return; if (appVersion) return;
if (!hasPermission(Permission.VIDEO_VIEW)) return;
getLocalVersion(); getLocalVersion();
}, [appVersion, getLocalVersion]); }, [appVersion, getLocalVersion, hasPermission]);
const ConnectionStatusElement = useMemo(() => { const ConnectionStatusElement = useMemo(() => {
const hasConnectionFailed = const hasConnectionFailed =