mirror of
https://github.com/woodchen-ink/clash-and-dashboard.git
synced 2025-07-18 14:01:56 +08:00
Fix: read general on proxy initial
This commit is contained in:
parent
c14ed17e14
commit
20ce22fba8
@ -95,9 +95,12 @@ function ProxyProviders () {
|
|||||||
|
|
||||||
function Proxies () {
|
function Proxies () {
|
||||||
const { proxies } = useProxy()
|
const { proxies } = useProxy()
|
||||||
|
const { update: updateGeneral } = useGeneral()
|
||||||
const { useTranslation } = useI18n()
|
const { useTranslation } = useI18n()
|
||||||
const { t } = useTranslation('Proxies')
|
const { t } = useTranslation('Proxies')
|
||||||
|
|
||||||
|
useSWR('general', updateGeneral)
|
||||||
|
|
||||||
function handleNotitySpeedTest () {
|
function handleNotitySpeedTest () {
|
||||||
EE.notifySpeedTest()
|
EE.notifySpeedTest()
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { atom, useRecoilState, selector } from 'recoil'
|
import { atom, useRecoilState, selector } from 'recoil'
|
||||||
import get from 'lodash/get'
|
import get from 'lodash/get'
|
||||||
|
import throttle from 'lodash/throttle'
|
||||||
import { useCallback } from 'react'
|
import { useCallback } from 'react'
|
||||||
import { AxiosError } from 'axios'
|
import { AxiosError } from 'axios'
|
||||||
|
|
||||||
@ -169,7 +170,7 @@ export function useGeneral () {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
return { general: data, update }
|
return { general: data, update: throttle(update, 50) }
|
||||||
}
|
}
|
||||||
|
|
||||||
export const proxies = atom({
|
export const proxies = atom({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user