diff options
| author | Haishan <[email protected]> | 2020-06-16 00:03:16 +0800 |
|---|---|---|
| committer | Haishan <[email protected]> | 2020-06-16 00:03:16 +0800 |
| commit | c848d8414e4186d2f7574466ccadbd63c9d99ba5 (patch) | |
| tree | 15f620bc43c3d0c296da341546a4096c6086a106 /src/components | |
| parent | 0bf2d72d05f285ddcc45179c0a4f64bbc675ad4b (diff) | |
fix: default to big latency for items with unavailable statistics when sorting
for https://github.com/haishanh/yacd/issues/496
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/proxies/ProxyGroup.tsx | 6 | ||||
| -rw-r--r-- | src/components/proxies/ProxyList.tsx | 2 |
2 files changed, 1 insertions, 7 deletions
diff --git a/src/components/proxies/ProxyGroup.tsx b/src/components/proxies/ProxyGroup.tsx index 4dd4fac..3ee995e 100644 --- a/src/components/proxies/ProxyGroup.tsx +++ b/src/components/proxies/ProxyGroup.tsx @@ -84,13 +84,9 @@ function ProxyGroupImpl({ name, all, type, now, isOpen, apiConfig, dispatch }) { } const getSortDelay = (d, w) => { - if (d === undefined) { - return 0; - } - if (!d.error && d.number > 0) { + if (d && typeof d.number === 'number' && d.number > 0) { return d.number; } - return w; }; diff --git a/src/components/proxies/ProxyList.tsx b/src/components/proxies/ProxyList.tsx index 850d360..6a6bf15 100644 --- a/src/components/proxies/ProxyList.tsx +++ b/src/components/proxies/ProxyList.tsx @@ -1,7 +1,5 @@ import * as React from 'react'; -/* import cx from 'clsx'; */ - import { Proxy, ProxySmall } from './Proxy'; import s from './ProxyList.module.css'; |
