Skip to content

Commit

Permalink
fix(proxies): also display latency when PROXIES_PREVIEW_TYPE is DOTS
Browse files Browse the repository at this point in the history
  • Loading branch information
kunish committed Sep 4, 2023
1 parent 2ff31d4 commit 347ebb6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
29 changes: 17 additions & 12 deletions src/components/ProxyPreviewDots.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { For } from 'solid-js'
import { twMerge } from 'tailwind-merge'
import { Latency } from '~/components'
import { latencyQualityMap, useProxies } from '~/signals'

const LatencyDots = (props: {
Expand Down Expand Up @@ -37,19 +38,23 @@ export const ProxyPreviewDots = (props: {
const { latencyMap } = useProxies()

return (
<div class="flex w-full flex-wrap items-center">
<For
each={props.proxyNameList.map((name): [string, number] => [
name,
latencyMap()[name],
])}
>
{([name, latency]) => {
const isSelected = props.now === name
<div class="flex items-center gap-2">
<div class="flex flex-1 flex-wrap items-center">
<For
each={props.proxyNameList.map((name): [string, number] => [
name,
latencyMap()[name],
])}
>
{([name, latency]) => {
const isSelected = props.now === name

return <LatencyDots latency={latency} selected={isSelected} />
}}
</For>
return <LatencyDots latency={latency} selected={isSelected} />
}}
</For>
</div>

<Latency name={props.now} />
</div>
)
}
2 changes: 1 addition & 1 deletion src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ export enum CONNECTIONS_TABLE_ACCESSOR_KEY {
Chains = 'chains',
DlSpeed = 'dlSpeed',
ULSpeed = 'ulSpeed',
ConnectTime = 'connectTime',
Download = 'dl',
Upload = 'ul',
ConnectTime = 'connectTime',
Source = 'source',
Destination = 'destination',
}
Expand Down

0 comments on commit 347ebb6

Please sign in to comment.