Revert "fix: improve Service connection method and permissions for Windows and Unix"
This reverts commit601e99f0b5. Revert "refactor: clash-verge-rev-service-ipc (#4841)" This reverts commit5370bd45ed.
This commit is contained in:
@@ -3,7 +3,6 @@ import { useCallback } from "react";
|
||||
|
||||
import { installService, restartCore } from "@/services/cmds";
|
||||
import { showNotice } from "@/services/noticeService";
|
||||
import { useSystemState } from "./use-system-state";
|
||||
|
||||
const executeWithErrorHandling = async (
|
||||
operation: () => Promise<void>,
|
||||
@@ -24,8 +23,6 @@ const executeWithErrorHandling = async (
|
||||
};
|
||||
|
||||
export const useServiceInstaller = () => {
|
||||
const { mutateRunningMode, mutateServiceOk } = useSystemState();
|
||||
|
||||
const installServiceAndRestartCore = useCallback(async () => {
|
||||
await executeWithErrorHandling(
|
||||
() => installService(),
|
||||
@@ -34,6 +31,6 @@ export const useServiceInstaller = () => {
|
||||
);
|
||||
|
||||
await executeWithErrorHandling(() => restartCore(), "Restarting Core...");
|
||||
}, [mutateRunningMode, mutateServiceOk]);
|
||||
}, []);
|
||||
return { installServiceAndRestartCore };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user