fix: provider proxy sort by delay

This commit is contained in:
GyDi
2022-11-11 01:21:23 +08:00
parent 515c07ea2b
commit 97dfa18b9b
3 changed files with 15 additions and 14 deletions

View File

@@ -59,17 +59,7 @@ const ProxyItem = (props: Props) => {
useEffect(() => {
if (!proxy) return;
if (!proxy.provider) {
setDelay(delayManager.getDelay(proxy.name, groupName));
return;
}
const { history = [] } = proxy;
if (history.length > 0) {
// 0ms以error显示
setDelay(history[history.length - 1].delay || 1e6);
}
setDelay(delayManager.getDelayFix(proxy, groupName));
}, [proxy]);
const onDelay = useLockFn(async () => {