Skip to content

Commit

Permalink
feat: auto restart core after grand permission
Browse files Browse the repository at this point in the history
  • Loading branch information
zzzgydi committed Mar 16, 2023
1 parent 9a29c9a commit 4ae409c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/setting/mods/clash-core-viewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ export const ClashCoreViewer = forwardRef<DialogRef>((props, ref) => {
const onGrant = useLockFn(async (core: string) => {
try {
await grantPermission(core);
// 自动重启
if (core === clash_core) await restartSidecar();
Notice.success(`Successfully grant permission to ${core}`, 1000);
} catch (err: any) {
Notice.error(err?.message || err.toString());
Expand Down

0 comments on commit 4ae409c

Please sign in to comment.