fix: remove built-in proxy type filtering

closes #4
This commit is contained in:
Haishan 2018-12-23 15:20:17 +08:00
parent a05a34e140
commit 852c91b44f
4 changed files with 6 additions and 21 deletions

View file

@ -8,14 +8,14 @@ import Button from 'c/Button';
import s0 from 'c/Proxies.module.scss';
import {
getUserProxies,
getProxies,
getProxyGroupNames,
fetchProxies,
requestDelayAll
} from 'd/proxies';
const mapStateToProps = s => ({
proxies: getUserProxies(s),
proxies: getProxies(s),
groupNames: getProxyGroupNames(s)
});

View file

@ -13,7 +13,7 @@ import fallback from 's/fallback.svg';
import s0 from './Proxy.module.scss';
import { getDelay, getUserProxies } from 'd/proxies';
import { getDelay, getProxies } from 'd/proxies';
const colors = {
Vmess: '#ca3487',
@ -31,11 +31,9 @@ const icons = {
Fallback: fallback.id
};
// typeof Proxy = 'Shadowsocks' | 'Vmess' | 'Socks5';
const mapStateToProps = s => {
return {
proxies: getUserProxies(s),
proxies: getProxies(s),
delay: getDelay(s)
};
};

View file

@ -6,10 +6,10 @@ import Proxy from 'c/Proxy';
import s0 from './ProxyGroup.module.scss';
import { getUserProxies, switchProxy } from 'd/proxies';
import { getProxies, switchProxy } from 'd/proxies';
const mapStateToProps = s => ({
proxies: getUserProxies(s)
proxies: getProxies(s)
});
// should move this to sth like constants.js

View file

@ -1,4 +1,3 @@
import { createSelector } from 'reselect';
import * as proxiesAPI from 'a/proxies';
import { getClashAPIConfig } from 'd/app';
@ -11,18 +10,6 @@ const ProxyGroupTypes = ['Fallback', 'URLTest', 'Selector'];
export const getProxies = s => s.proxies.proxies;
export const getDelay = s => s.proxies.delay;
export const getProxyGroupNames = s => s.proxies.groupNames;
export const getUserProxies = createSelector(
getProxies,
proxies => {
let o = {};
for (const prop in proxies) {
if (ProxyTypeBuiltin.indexOf(prop) < 0) {
o[prop] = proxies[prop];
}
}
return o;
}
);
const CompletedFetchProxies = 'proxies/CompletedFetchProxies';
const OptimisticSwitchProxy = 'proxies/OptimisticSwitchProxy';