refactor: optimize swr data refresh paths

This commit is contained in:
Tunglies
2026-06-28 19:42:21 +08:00
parent e71e701fd0
commit b9da0875cd
16 changed files with 153 additions and 162 deletions
+2 -3
View File
@@ -6,8 +6,7 @@ import {
patchProfile,
patchProfilesConfig,
} from '@/services/cmds'
import { useQuery } from '@/services/query-client'
import { queryClient } from '@/services/query-client'
import { setCacheData, useQuery } from '@/services/query-client'
import { debugLog } from '@/utils/debug'
export const useProfiles = () => {
@@ -201,7 +200,7 @@ export const useProfiles = () => {
await patchProfile(current.uid, { selected: newSelected })
debugLog('[ActivateSelected] 代理选择配置保存成功')
queryClient.setQueryData(['getProxies'], await calcuProxies())
setCacheData(['getProxies'], await calcuProxies())
} catch (error: unknown) {
console.error(
'[ActivateSelected] 保存代理选择配置失败:',