fix ui lint errors

This commit is contained in:
Siyuan 2025-10-10 13:59:11 +00:00
parent 59b7141d84
commit feec19ab13
3 changed files with 5 additions and 4 deletions

View File

@ -1,4 +1,5 @@
import { cx } from "@/cva.config"; import { cx } from "@/cva.config";
import { NetworkState } from "../hooks/stores"; import { NetworkState } from "../hooks/stores";
import { LifeTimeLabel } from "../routes/devices.$id.settings.network"; import { LifeTimeLabel } from "../routes/devices.$id.settings.network";

View File

@ -127,7 +127,7 @@ export default function SettingsNetworkRoute() {
notifications.error(err instanceof Error ? err.message : "Unknown error"); notifications.error(err instanceof Error ? err.message : "Unknown error");
throw err; throw err;
} }
}, []); }, [setNetworkState]);
const formMethods = useForm<NetworkSettings>({ const formMethods = useForm<NetworkSettings>({
mode: "onBlur", mode: "onBlur",
@ -155,7 +155,7 @@ export default function SettingsNetworkRoute() {
const { register, handleSubmit, watch, formState, reset } = formMethods; const { register, handleSubmit, watch, formState, reset } = formMethods;
const onSubmit = async (settings: NetworkSettings) => { const onSubmit = async (settings: NetworkSettings) => {
send("setNetworkSettings", { settings }, async (resp: any) => { send("setNetworkSettings", { settings }, async (resp) => {
if ("error" in resp) { if ("error" in resp) {
return notifications.error( return notifications.error(
resp.error.data ? resp.error.data : resp.error.message, resp.error.data ? resp.error.data : resp.error.message,
@ -205,7 +205,7 @@ export default function SettingsNetworkRoute() {
const ipv6mode = watch("ipv6_mode"); const ipv6mode = watch("ipv6_mode");
const onDhcpLeaseRenew = () => { const onDhcpLeaseRenew = () => {
send("renewDHCPLease", {}, (resp: any) => { send("renewDHCPLease", {}, (resp) => {
if ("error" in resp) { if ("error" in resp) {
notifications.error("Failed to renew lease: " + resp.error.message); notifications.error("Failed to renew lease: " + resp.error.message);
} else { } else {

View File

@ -41,7 +41,7 @@ export function callJsonRpc(options: JsonRpcCallOptions): Promise<JsonRpcCallRes
}; };
const timeout = options.timeout || 5000; const timeout = options.timeout || 5000;
let timeoutId: number | undefined; let timeoutId: number | undefined; // eslint-disable-line prefer-const
const messageHandler = (event: MessageEvent) => { const messageHandler = (event: MessageEvent) => {
try { try {