fix: version info not loading in feature flags and settings

The getLocalVersion() call was happening before the WebRTC RPC data
channel was established, causing version fetch to fail silently.

This resulted in:
- Feature flags always returning false (no version = disabled)
- Settings UI showing "App: Loading..." and "System: Loading..." indefinitely
- Version-gated features (like HDMI Sleep Mode) never appearing

Fixed by adding rpcDataChannel readyState check before calling
getLocalVersion(), matching the pattern used by all other RPC calls
in the same file.
This commit is contained in:
Alex P 2025-10-18 00:33:22 +03:00
parent c8808ee3b2
commit 8189861bfa
1 changed files with 2 additions and 1 deletions

View File

@ -898,10 +898,11 @@ export default function KvmIdRoute() {
useEffect(() => {
if (appVersion) return;
if (rpcDataChannel?.readyState !== "open") return;
getLocalVersion();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [appVersion]);
}, [appVersion, rpcDataChannel?.readyState]);
const ConnectionStatusElement = useMemo(() => {
const isOtherSession = location.pathname.includes("other-session");