fix: fix color display for unavailable proxy item

This commit is contained in:
Haishan 2020-06-20 22:33:50 +08:00
parent 632c6a3735
commit c600c7840a

View file

@ -1,7 +1,7 @@
import cx from 'clsx'; import cx from 'clsx';
import * as React from 'react'; import * as React from 'react';
import { getDelay,getProxies, NonProxyTypes } from '../../store/proxies'; import { getDelay, getProxies, NonProxyTypes } from '../../store/proxies';
import { connect } from '../StateProvider'; import { connect } from '../StateProvider';
import s0 from './Proxy.module.css'; import s0 from './Proxy.module.css';
import { ProxyLatency } from './ProxyLatency'; import { ProxyLatency } from './ProxyLatency';
@ -24,7 +24,9 @@ function getLabelColor({
}: { }: {
number?: number; number?: number;
} = {}) { } = {}) {
if (number < 200) { if (number === 0) {
return colorMap.na;
} else if (number < 200) {
return colorMap.good; return colorMap.good;
} else if (number < 400) { } else if (number < 400) {
return colorMap.normal; return colorMap.normal;