refactor: base components

This commit is contained in:
Slinetrac
2025-10-14 21:13:10 +08:00
parent 2e3174baa7
commit 65cf6c387b
6 changed files with 111 additions and 77 deletions

View File

@@ -3,6 +3,7 @@ import { useCallback } from "react";
import { installService, restartCore } from "@/services/cmds";
import { showNotice } from "@/services/noticeService";
import { useSystemState } from "./use-system-state";
const executeWithErrorHandling = async (
@@ -34,6 +35,8 @@ export const useServiceInstaller = () => {
);
await executeWithErrorHandling(() => restartCore(), "Restarting Core...");
await mutateRunningMode();
await mutateServiceOk();
}, [mutateRunningMode, mutateServiceOk]);
return { installServiceAndRestartCore };
};

View File

@@ -37,6 +37,8 @@ export const useServiceUninstaller = () => {
);
await executeWithErrorHandling(() => restartCore(), "Restarting Core...");
await mutateRunningMode();
await mutateServiceOk();
}, [mutateRunningMode, mutateServiceOk]);
return { uninstallServiceAndRestartCore };