Optimize provider page

Optimize delay test

Support local backup and recovery
This commit is contained in:
chen08209
2024-08-04 08:21:14 +08:00
parent 6cfcaa4edc
commit bee2f8aa4f
53 changed files with 1993 additions and 1128 deletions

View File

@@ -42,7 +42,7 @@ double getItemHeight(ProxyCardType proxyCardType) {
delayTest(List<Proxy> proxies) async {
final appController = globalState.appController;
for (final proxy in proxies) {
final delayProxies = proxies.map<Future>((proxy) async {
final proxyName = appController.appState.getRealProxyName(proxy.name);
globalState.appController.setDelay(
Delay(
@@ -50,11 +50,9 @@ delayTest(List<Proxy> proxies) async {
value: 0,
),
);
clashCore.getDelay(proxyName).then((delay) {
globalState.appController.setDelay(delay);
});
}
await Future.delayed(httpTimeoutDuration + moreDuration);
globalState.appController.setDelay(await clashCore.getDelay(proxyName));
});
await Future.wait(delayProxies);
appController.appState.sortNum++;
}