mirror of https://github.com/jetkvm/kvm.git
now loads name config on page load
This commit is contained in:
parent
6771755b32
commit
5a5a477966
|
@ -18,6 +18,13 @@ export default function SettingsAppearanceRoute() {
|
|||
});
|
||||
const [send] = useJsonRpc();
|
||||
|
||||
send("getNameConfig", {}, resp => {
|
||||
if ("error" in resp) return;
|
||||
const results = resp.result as NameConfig;
|
||||
setNameConfig(results);
|
||||
document.title = results.name;
|
||||
});
|
||||
|
||||
const handleThemeChange = useCallback((value: string) => {
|
||||
const root = document.documentElement;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import { cx } from "@/cva.config";
|
||||
import {
|
||||
HidState,
|
||||
HidState, NameConfig,
|
||||
UpdateState,
|
||||
useDeviceStore,
|
||||
useHidStore,
|
||||
|
@ -378,6 +378,15 @@ export default function KvmIdRoute() {
|
|||
});
|
||||
}, [rpcDataChannel?.readyState, send, setHdmiState]);
|
||||
|
||||
useEffect(() => {
|
||||
send("getNameConfig", {}, resp => {
|
||||
if ("error" in resp) return;
|
||||
const results = resp.result as NameConfig;
|
||||
document.title = results.name;
|
||||
});
|
||||
}, [send]);
|
||||
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-expect-error
|
||||
window.send = send;
|
||||
|
|
Loading…
Reference in New Issue