fix(proxy): dont hideUnAvailableProxies in proxy providers

This commit is contained in:
kunish 2023-09-16 14:28:21 +08:00
parent fa9ea90bce
commit be6edd914a
No known key found for this signature in database
GPG Key ID: 647A12B4F782C430
2 changed files with 15 additions and 17 deletions

View File

@ -291,9 +291,7 @@ const ConfigForXd = () => {
{
label: t('autoSwitchTheme'),
value: autoSwitchTheme,
onChange: (value: boolean) => {
setAutoSwitchTheme(value)
},
onChange: (value: boolean) => setAutoSwitchTheme(value),
subChild: autoSwitchThemeSubChild,
},
{

View File

@ -4,7 +4,7 @@ import {
IconReload,
IconSettings,
} from '@tabler/icons-solidjs'
import { For, Show, createSignal } from 'solid-js'
import { For, Show, createMemo, createSignal } from 'solid-js'
import { twMerge } from 'tailwind-merge'
import {
Button,
@ -154,7 +154,8 @@ export default () => {
<div class="grid grid-cols-1 place-items-start gap-2 sm:grid-cols-2">
<For each={proxies()}>
{(proxy) => {
const sortedProxyNames = filterProxiesByAvailability(
const sortedProxyNames = createMemo(() =>
filterProxiesByAvailability(
sortProxiesByOrderingType(
proxy.all ?? [],
latencyMap(),
@ -162,6 +163,7 @@ export default () => {
),
latencyMap(),
hideUnAvailableProxies(),
),
)
const title = (
@ -192,7 +194,7 @@ export default () => {
<Show when={!collapsedMap()[proxy.name]}>
<ProxyNodePreview
proxyNameList={sortedProxyNames}
proxyNameList={sortedProxyNames()}
now={proxy.now}
/>
</Show>
@ -206,7 +208,7 @@ export default () => {
onCollapse={(val) => setCollapsedMap(proxy.name, val)}
>
<ProxyCardGroups
proxyNames={sortedProxyNames}
proxyNames={sortedProxyNames()}
now={proxy.now}
onClick={(name) => void onProxyNodeClick(proxy, name)}
/>
@ -221,14 +223,12 @@ export default () => {
<div class="grid grid-cols-1 place-items-start gap-2 sm:grid-cols-2">
<For each={proxyProviders()}>
{(proxyProvider) => {
const sortedProxyNames = filterProxiesByAvailability(
const sortedProxyNames = createMemo(() =>
sortProxiesByOrderingType(
proxyProvider.proxies.map((i) => i.name) ?? [],
latencyMap(),
proxiesOrderingType(),
),
latencyMap(),
hideUnAvailableProxies(),
)
const title = (
@ -284,7 +284,7 @@ export default () => {
</div>
<Show when={!collapsedMap()[proxyProvider.name]}>
<ProxyNodePreview proxyNameList={sortedProxyNames} />
<ProxyNodePreview proxyNameList={sortedProxyNames()} />
</Show>
</>
)
@ -297,7 +297,7 @@ export default () => {
setCollapsedMap(proxyProvider.name, val)
}
>
<ProxyCardGroups proxyNames={sortedProxyNames} />
<ProxyCardGroups proxyNames={sortedProxyNames()} />
</Collapse>
)
}}