mirror of https://github.com/jetkvm/kvm.git
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:
parent
a1548fe5b1
commit
ffc4a2af21
|
|
@ -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(() => {
|
||||||
|
|
|
||||||
|
|
@ -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 =
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue