mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-11-24 09:45:35 +08:00
fix: update proxies
This commit is contained in:
parent
8d46254bcf
commit
467d0bcce2
@ -17,14 +17,19 @@ import {
|
|||||||
For,
|
For,
|
||||||
ParentComponent,
|
ParentComponent,
|
||||||
Show,
|
Show,
|
||||||
|
createEffect,
|
||||||
createMemo,
|
createMemo,
|
||||||
createSignal,
|
createSignal,
|
||||||
onMount,
|
|
||||||
} from 'solid-js'
|
} from 'solid-js'
|
||||||
import { twMerge } from 'tailwind-merge'
|
import { twMerge } from 'tailwind-merge'
|
||||||
import { LANG, ROUTE } from '~/config/enum'
|
import { LANG, ROUTE } from '~/config/enum'
|
||||||
import { themes } from '~/constants'
|
import { themes } from '~/constants'
|
||||||
import { setCurTheme, setSelectedEndpoint } from '~/signals'
|
import {
|
||||||
|
endpoint,
|
||||||
|
selectedEndpoint,
|
||||||
|
setCurTheme,
|
||||||
|
setSelectedEndpoint,
|
||||||
|
} from '~/signals'
|
||||||
import { useProxies } from '~/signals/proxies'
|
import { useProxies } from '~/signals/proxies'
|
||||||
|
|
||||||
const Nav: ParentComponent<{ href: string; tooltip: string }> = ({
|
const Nav: ParentComponent<{ href: string; tooltip: string }> = ({
|
||||||
@ -74,10 +79,13 @@ const ThemeSwitcher = () => (
|
|||||||
|
|
||||||
export const Header = () => {
|
export const Header = () => {
|
||||||
const [t, { locale }] = useI18n()
|
const [t, { locale }] = useI18n()
|
||||||
const { updateProxy, proxyProviders } = useProxies()
|
const { proxyProviders } = useProxies()
|
||||||
|
|
||||||
onMount(() => {
|
createEffect(() => {
|
||||||
updateProxy()
|
// Need fix: useRequest is not reactive so we need to useProxies again or request wont have endpoint
|
||||||
|
if (selectedEndpoint() && endpoint()) {
|
||||||
|
useProxies().updateProxy()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const navs = createMemo(() => {
|
const navs = createMemo(() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user