refactor: replace println with logging in core validation and tray quit function

This commit is contained in:
Tunglies
2025-03-26 04:31:38 +08:00
parent 0ec4f46052
commit 98d3a48710
6 changed files with 298 additions and 79 deletions

View File

@@ -40,11 +40,18 @@ const SettingSystem = ({ onError }: Props) => {
"getRunningMode",
getRunningMode,
);
const { data: autoLaunchEnabled } = useSWR("getAutoLaunchStatus", getAutoLaunchStatus);
const { data: autoLaunchEnabled } = useSWR(
"getAutoLaunchStatus",
getAutoLaunchStatus,
);
// 当实际自启动状态与配置不同步时更新配置
useEffect(() => {
if (autoLaunchEnabled !== undefined && verge && verge.enable_auto_launch !== autoLaunchEnabled) {
if (
autoLaunchEnabled !== undefined &&
verge &&
verge.enable_auto_launch !== autoLaunchEnabled
) {
// 静默更新配置不触发UI刷新
mutateVerge({ ...verge, enable_auto_launch: autoLaunchEnabled }, false);
}