Fix LoadBalance, Relay load error

(cherry picked from commit 7acf9c6db3)
This commit is contained in:
chen08209
2024-06-09 20:53:36 +08:00
parent 9fc9c53427
commit 1a74c0a12f
3 changed files with 10 additions and 3 deletions

View File

@@ -199,10 +199,15 @@ class ProxiesTabView extends StatelessWidget {
_delayTest(List<Proxy> proxies) async {
for (final proxy in proxies) {
final appController = globalState.appController;
final proxyName = appController.appState.getRealProxyName(proxy.name) ?? proxy.name;
globalState.appController.setDelay(
Delay(name: proxy.name, value: 0),
Delay(
name: proxyName,
value: 0,
),
);
clashCore.getDelay(proxy.name).then((delay) {
clashCore.getDelay(proxyName).then((delay) {
globalState.appController.setDelay(delay);
});
}

View File

@@ -107,7 +107,7 @@ class AppState with ChangeNotifier {
} else {
final index = groups.indexWhere((element) => element.name == proxyName);
if (index == -1) return type;
return "$type(${groups[index].now})";
return "$type(${groups[index].now ?? '*'})";
}
}

View File

@@ -28,6 +28,8 @@ const _$GroupTypeEnumMap = {
GroupType.Selector: 'Selector',
GroupType.URLTest: 'URLTest',
GroupType.Fallback: 'Fallback',
GroupType.LoadBalance: 'LoadBalance',
GroupType.Relay: 'Relay',
};
_$ProxyImpl _$$ProxyImplFromJson(Map<String, dynamic> json) => _$ProxyImpl(