refactor: base components
This commit is contained in:
@@ -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 };
|
||||
};
|
||||
|
||||
@@ -37,6 +37,8 @@ export const useServiceUninstaller = () => {
|
||||
);
|
||||
|
||||
await executeWithErrorHandling(() => restartCore(), "Restarting Core...");
|
||||
await mutateRunningMode();
|
||||
await mutateServiceOk();
|
||||
}, [mutateRunningMode, mutateServiceOk]);
|
||||
|
||||
return { uninstallServiceAndRestartCore };
|
||||
|
||||
Reference in New Issue
Block a user