From 81fe55091292015b623e2545fd7d0547cfffbed0 Mon Sep 17 00:00:00 2001 From: kunish Date: Sun, 24 Sep 2023 15:29:26 +0800 Subject: [PATCH] fix(proxy): fetch proxies after latency test --- src/App.tsx | 5 ----- src/pages/Proxies.tsx | 7 +++++-- src/signals/proxies.ts | 3 ++- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index b33f3e3..c48193c 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -15,7 +15,6 @@ import { favNightTheme, setCurTheme, setLatestConnectionMsg, - useProxies, useTwemoji, useWsRequest, } from '~/signals' @@ -29,10 +28,6 @@ const Rules = lazy(() => import('~/pages/Rules')) const Config = lazy(() => import('~/pages/Config')) const ProtectedResources = () => { - const { fetchProxies } = useProxies() - - onMount(fetchProxies) - const latestConnectionMsg = useWsRequest('connections') createEffect(() => { diff --git a/src/pages/Proxies.tsx b/src/pages/Proxies.tsx index 5f76411..eaa9035 100644 --- a/src/pages/Proxies.tsx +++ b/src/pages/Proxies.tsx @@ -3,7 +3,7 @@ import { IconReload, IconSettings, } from '@tabler/icons-solidjs' -import { For, Show, createMemo, createSignal } from 'solid-js' +import { For, Show, createMemo, createSignal, onMount } from 'solid-js' import { twMerge } from 'tailwind-merge' import { Button, @@ -38,6 +38,7 @@ export default () => { const [t] = useI18n() const { + fetchProxies, proxies, selectProxyInGroup, latencyTestByProxyGroupName, @@ -48,6 +49,8 @@ export default () => { healthCheckByProviderName, } = useProxies() + onMount(fetchProxies) + const { map: collapsedMap, set: setCollapsedMap } = useStringBooleanMap() const { map: latencyTestingMap, setWithCallback: setLatencyTestingMap } = useStringBooleanMap() @@ -100,7 +103,7 @@ export default () => { return (
-
+
{(tab) => (