Browse Source

fix: enhance when change tun config

MystiPanda 1 năm trước cách đây
mục cha
commit
3271c96531
1 tập tin đã thay đổi với 7 bổ sung0 xóa
  1. 7 0
      src/components/setting/mods/tun-viewer.tsx

+ 7 - 0
src/components/setting/mods/tun-viewer.tsx

@@ -13,6 +13,7 @@ import {
 import { useClash } from "@/hooks/use-clash";
 import { BaseDialog, DialogRef, Notice, Switch } from "@/components/base";
 import { StackModeSwitch } from "./stack-mode-switch";
+import { enhanceProfiles } from "@/services/cmds";
 
 export const TunViewer = forwardRef<DialogRef>((props, ref) => {
   const { t } = useTranslation();
@@ -65,6 +66,12 @@ export const TunViewer = forwardRef<DialogRef>((props, ref) => {
         }),
         false
       );
+      try {
+        await enhanceProfiles();
+        Notice.success("Refresh clash config", 1000);
+      } catch (err: any) {
+        Notice.error(err.message || err.toString(), 3000);
+      }
       setOpen(false);
     } catch (err: any) {
       Notice.error(err.message || err.toString());