perf: narrow app data subscriptions

This commit is contained in:
Tunglies
2026-04-29 10:18:03 +08:00
parent 33d7988ac9
commit 6e0647f7b2
17 changed files with 136 additions and 45 deletions
+3 -2
View File
@@ -40,7 +40,7 @@ import {
selectNodeForGroup,
} from 'tauri-plugin-mihomo-api'
import { useAppData } from '@/providers/app-data-context'
import { useAppRefreshers, useProxiesData } from '@/providers/app-data-context'
import { updateProxyChainConfigInRuntime } from '@/services/cmds'
import { debugLog } from '@/utils/debug'
@@ -251,7 +251,8 @@ export const ProxyChain = ({
}: ProxyChainProps) => {
const theme = useTheme()
const { t } = useTranslation()
const { proxies, refreshProxy } = useAppData()
const { proxies } = useProxiesData()
const { refreshProxy } = useAppRefreshers()
const [isConnecting, setIsConnecting] = useState(false)
const markUnsavedChanges = useCallback(() => {
onMarkUnsavedChanges?.()