kvm/ui/src/hooks
Alex P f9e190f8b9 fix: prevent multiple getPermissions RPC calls on page load
The getPermissions useEffect had send and pollPermissions in its dependency
array. Since send gets recreated when rpcDataChannel changes, this caused
multiple getPermissions RPC calls (5 observed) on page load.

Fix:
- Add rpcDataChannel readiness check to prevent calls before channel is open
- Remove send and pollPermissions from dependency array
- Keep only currentMode and rpcDataChannel.readyState as dependencies

This ensures getPermissions is called only when:
1. The RPC channel becomes ready (readyState changes to "open")
2. The session mode changes (observer <-> primary)

Eliminates duplicate RPC calls while maintaining correct behavior for
mode changes and initial connection.
2025-10-10 22:23:25 +03:00
..
hidRpc.ts feat: release keyPress automatically (#796) 2025-09-18 13:35:47 +02:00
stores.ts feat: improve session approval workflow with re-request and rejection limits 2025-10-08 21:37:02 +03:00
useAppNavigation.ts Upgrade vite and react-router (#778) 2025-09-04 12:20:01 +02:00
useFeatureFlag.ts Apply and Upgrade Eslint (#288) 2025-03-25 11:56:24 +01:00
useHidRpc.ts feat: release keyPress automatically (#796) 2025-09-18 13:35:47 +02:00
useJsonRpc.ts feat: multi-session support with role-based permissions 2025-10-08 18:52:45 +03:00
useKeyboard.ts feat: release keyPress automatically (#796) 2025-09-18 13:35:47 +02:00
useKeyboardLayout.ts Add ability to track modifier state on the device (#725) 2025-08-26 17:09:35 +02:00
useMouse.ts feat: hid rpc channel (#755) 2025-09-04 22:27:56 +02:00
usePermissions.ts fix: prevent multiple getPermissions RPC calls on page load 2025-10-10 22:23:25 +03:00
useSessionEvents.ts feat: improve session approval workflow with re-request and rejection limits 2025-10-08 21:37:02 +03:00
useSessionManagement.ts feat: improve session approval workflow with re-request and rejection limits 2025-10-08 21:37:02 +03:00
useVersion.tsx feat: get local version only (#813) 2025-09-19 13:45:59 +02:00