dropdown button & global switch

This commit is contained in:
hitsmaxft 2020-02-09 22:28:27 +08:00 committed by Haishan
parent c206c33697
commit bd82b8c5e3
2 changed files with 3 additions and 4 deletions

View file

@ -5,7 +5,7 @@ import { ChevronsDown } from 'react-feather';
import cx from 'classnames'; import cx from 'classnames';
import { connect } from './StateProvider'; import { connect } from './StateProvider';
import { getDelay, getProxies, getRtFilterSwitch } from '../store/proxies'; import { getDelay, getRtFilterSwitch } from '../store/proxies';
import Proxy, { ProxySmall } from './Proxy'; import Proxy, { ProxySmall } from './Proxy';
import { SectionNameType } from './shared/Basic'; import { SectionNameType } from './shared/Basic';
@ -124,14 +124,14 @@ const getSortDelay = (d, w) => {
const mapState = (s, { all }) => { const mapState = (s, { all }) => {
const delay = getDelay(s); const delay = getDelay(s);
const filterError = getRtFilterSwitch(s); const filterByRt = getRtFilterSwitch(s);
const groupList = []; const groupList = [];
const proxyList = []; const proxyList = [];
let clonelist = [...all]; let clonelist = [...all];
if (filterError) { if (filterByRt) {
const filterList = clonelist.filter(name => { const filterList = clonelist.filter(name => {
const d = delay[name]; const d = delay[name];
if (d === undefined) { if (d === undefined) {

View file

@ -28,7 +28,6 @@ const ProxyTypes = ['Shadowsocks', 'Snell', 'Socks5', 'Http', 'Vmess'];
export const getProxies = s => s.proxies.proxies; export const getProxies = s => s.proxies.proxies;
export const getDelay = s => s.proxies.delay; export const getDelay = s => s.proxies.delay;
export const getRtFilterSwitch = s => s.filterZeroRT; export const getRtFilterSwitch = s => s.filterZeroRT;
export const switchRtFilter = s => (s.filterZeroRT = !getRtFilterSwitch(s));
export const getProxyGroupNames = s => s.proxies.groupNames; export const getProxyGroupNames = s => s.proxies.groupNames;
export const getProxyProviders = s => s.proxies.proxyProviders || []; export const getProxyProviders = s => s.proxies.proxyProviders || [];
export const getDangleProxyNames = s => s.proxies.dangleProxyNames; export const getDangleProxyNames = s => s.proxies.dangleProxyNames;