mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-10-28 17:22:15 +08:00
fix: defer provider queries on startup
This commit is contained in:
@@ -18,7 +18,7 @@ import {
|
||||
} from '@mui/material'
|
||||
import { useLockFn } from 'ahooks'
|
||||
import dayjs from 'dayjs'
|
||||
import { useState } from 'react'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { updateProxyProvider } from 'tauri-plugin-mihomo-api'
|
||||
|
||||
@@ -52,6 +52,10 @@ export const ProviderButton = () => {
|
||||
const { refreshProxy, refreshProxyProviders } = useAppRefreshers()
|
||||
const [updating, setUpdating] = useState<Record<string, boolean>>({})
|
||||
|
||||
useEffect(() => {
|
||||
refreshProxyProviders().catch(() => {})
|
||||
}, [refreshProxyProviders])
|
||||
|
||||
// 检查是否有提供者
|
||||
const hasProviders = Object.keys(proxyProviders || {}).length > 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user