From a3c7e688bbe6d6002d834fbc804612120aa29913 Mon Sep 17 00:00:00 2001 From: Purp1e <47248616+Purple-CSGO@users.noreply.github.com> Date: Sun, 23 Mar 2025 23:29:15 +0800 Subject: [PATCH] [fix] lint errors due to autostart frontend --- src/app/(main)/preference/general/page.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/app/(main)/preference/general/page.tsx b/src/app/(main)/preference/general/page.tsx index 0b60c76..77a757b 100644 --- a/src/app/(main)/preference/general/page.tsx +++ b/src/app/(main)/preference/general/page.tsx @@ -2,9 +2,15 @@ import { useAppStore } from "@/store/app" import { Switch } from "@heroui/react" import { enable, isEnabled, disable } from "@tauri-apps/plugin-autostart" +import { useEffect, useState } from "react" export default function Page() { const app = useAppStore() + const [autoStartEnabled, setAutoStartEnabled] = useState(false) + + useEffect(() => { + void isEnabled().then(setAutoStartEnabled) + }, []) return (
是否有更新:{app.state.hasUpdate ? "有" : "无"}
是否使用镜像源:{app.state.useMirror ? "是" : "否"}