Просмотр исходного кода

fix: Config data display error

#417
MystiPanda 1 год назад
Родитель
Сommit
1cff162649
3 измененных файлов с 10 добавлено и 10 удалено
  1. 1 1
      src/components/setting/mods/tun-viewer.tsx
  2. 7 8
      src/hooks/use-clash.ts
  3. 2 1
      src/services/cmds.ts

+ 1 - 1
src/components/setting/mods/tun-viewer.tsx

@@ -113,7 +113,7 @@ export const TunViewer = forwardRef<DialogRef>((props, ref) => {
             spellCheck="false"
             sx={{ width: 250 }}
             value={values.device}
-            placeholder="Mihomo"
+            placeholder="Meta"
             onChange={(e) =>
               setValues((v) => ({ ...v, device: e.target.value }))
             }

+ 7 - 8
src/hooks/use-clash.ts

@@ -1,17 +1,16 @@
 import useSWR, { mutate } from "swr";
 import { useLockFn } from "ahooks";
+import { getAxios, getVersion, updateConfigs } from "@/services/api";
 import {
-  getAxios,
-  getClashConfig,
-  getVersion,
-  updateConfigs,
-} from "@/services/api";
-import { getClashInfo, patchClashConfig } from "@/services/cmds";
+  getClashInfo,
+  patchClashConfig,
+  getRuntimeConfig,
+} from "@/services/cmds";
 
 export const useClash = () => {
   const { data: clash, mutate: mutateClash } = useSWR(
-    "getClashConfig",
-    getClashConfig
+    "getRuntimeConfig",
+    getRuntimeConfig
   );
 
   const { data: versionData, mutate: mutateVersion } = useSWR(

+ 2 - 1
src/services/cmds.ts

@@ -90,8 +90,9 @@ export async function getClashInfo() {
   return invoke<IClashInfo | null>("get_clash_info");
 }
 
+// Get runtime config which controlled by verge
 export async function getRuntimeConfig() {
-  return invoke<any | null>("get_runtime_config");
+  return invoke<IConfigData | null>("get_runtime_config");
 }
 
 export async function getRuntimeYaml() {