fix proxy name resolution
This commit is contained in:
@@ -27,6 +27,9 @@ import 'package:weblibre/features/proxy/domain/repositories/singbox_proxy_profil
|
||||
|
||||
part 'proxy_connection_options.g.dart';
|
||||
|
||||
const loadingProxyTitle = 'Loading proxy...';
|
||||
const unknownProxyTitle = 'Unknown proxy';
|
||||
|
||||
class ProxyConnectionOption with FastEquatable {
|
||||
final ProxyConnectionId id;
|
||||
final String title;
|
||||
@@ -72,13 +75,21 @@ List<ProxyConnectionOption> proxyConnectionOptions(Ref ref) {
|
||||
|
||||
String proxyConnectionTitle(
|
||||
List<ProxyConnectionOption> options,
|
||||
ProxyConnectionId proxyConnectionId,
|
||||
) {
|
||||
ProxyConnectionId proxyConnectionId, {
|
||||
bool isLoading = false,
|
||||
}) {
|
||||
for (final option in options) {
|
||||
if (option.id == proxyConnectionId) {
|
||||
return option.title;
|
||||
}
|
||||
}
|
||||
|
||||
return 'Unknown proxy';
|
||||
return isLoading ? loadingProxyTitle : unknownProxyTitle;
|
||||
}
|
||||
|
||||
bool proxyConnectionOptionExists(
|
||||
List<ProxyConnectionOption> options,
|
||||
ProxyConnectionId proxyConnectionId,
|
||||
) {
|
||||
return options.any((option) => option.id == proxyConnectionId);
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ final class SingboxProxyRuntimeRepositoryProvider
|
||||
}
|
||||
|
||||
String _$singboxProxyRuntimeRepositoryHash() =>
|
||||
r'bb84ab57abd3b7261105da85d3e047cef1b31a44';
|
||||
r'660543fd3f82a5fcc5c3c85b11d0a98d472638af';
|
||||
|
||||
abstract class _$SingboxProxyRuntimeRepository
|
||||
extends $AsyncNotifier<SingboxProxyRuntimeState> {
|
||||
|
||||
Reference in New Issue
Block a user