mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-08 19:22:44 +08:00
perf: narrow app data subscriptions
This commit is contained in:
@@ -34,7 +34,7 @@ import {
|
||||
import { EditorViewer } from '@/components/profile/editor-viewer'
|
||||
import { useSystemProxyState } from '@/hooks/use-system-proxy-state'
|
||||
import { useVerge } from '@/hooks/use-verge'
|
||||
import { useAppData } from '@/providers/app-data-context'
|
||||
import { useClashConfigData, useSystemData } from '@/providers/app-data-context'
|
||||
import {
|
||||
getAutotemProxy,
|
||||
getNetworkInterfacesInfo,
|
||||
@@ -108,7 +108,7 @@ export const SysproxyViewer = forwardRef<DialogRef>((props, ref) => {
|
||||
const { verge, patchVerge, mutateVerge } = useVerge()
|
||||
const [hostOptions, setHostOptions] = useState<string[]>([])
|
||||
|
||||
const { clashConfig } = useAppData()
|
||||
const { clashConfig } = useClashConfigData()
|
||||
const { indicator: isProxyReallyEnabled, invalidateProxyState } =
|
||||
useSystemProxyState()
|
||||
|
||||
@@ -179,7 +179,7 @@ export const SysproxyViewer = forwardRef<DialogRef>((props, ref) => {
|
||||
updateProxy()
|
||||
}, [clashConfig?.mixedPort, enabled, value.pac, invalidateProxyState])
|
||||
|
||||
const { systemProxyAddress } = useAppData()
|
||||
const { systemProxyAddress } = useSystemData()
|
||||
|
||||
// 为当前状态计算系统代理地址
|
||||
const getSystemProxyAddress = useMemo(() => {
|
||||
|
||||
@@ -16,7 +16,7 @@ import { useTranslation } from 'react-i18next'
|
||||
|
||||
import { BaseDialog } from '@/components/base'
|
||||
import { useClash } from '@/hooks/use-clash'
|
||||
import { useAppData } from '@/providers/app-data-context'
|
||||
import { useProxiesData } from '@/providers/app-data-context'
|
||||
import { isPortInUse } from '@/services/cmds'
|
||||
import { showNotice } from '@/services/notice-service'
|
||||
import {
|
||||
@@ -92,7 +92,7 @@ export const TunnelsViewer = forwardRef<TunnelsViewerRef>((_, ref) => {
|
||||
})
|
||||
}, [draftTunnels])
|
||||
|
||||
const { proxies } = useAppData()
|
||||
const { proxies } = useProxiesData()
|
||||
|
||||
const proxyGroups = useMemo<IProxyGroupItem[]>(() => {
|
||||
return proxies?.groups ?? []
|
||||
|
||||
Reference in New Issue
Block a user