fix proxy name resolution
This commit is contained in:
+1
-1
@@ -42,7 +42,7 @@ final class ProxySettingsReplicationProvider
|
||||
}
|
||||
|
||||
String _$proxySettingsReplicationHash() =>
|
||||
r'3a7f15c1e09e304d355dada2de80112dec0adbf4';
|
||||
r'42dcd4ec7bc5a00804f729178b99c56e8c917850';
|
||||
|
||||
abstract class _$ProxySettingsReplication extends $Notifier<void> {
|
||||
void build();
|
||||
|
||||
+22
-2
@@ -38,6 +38,7 @@ import 'package:weblibre/features/geckoview/features/tabs/utils/container_colors
|
||||
import 'package:weblibre/features/geckoview/features/tabs/utils/container_icons.dart';
|
||||
import 'package:weblibre/features/proxy/data/proxy_connection.dart';
|
||||
import 'package:weblibre/features/proxy/domain/providers/proxy_connection_options.dart';
|
||||
import 'package:weblibre/features/proxy/domain/repositories/singbox_proxy_profiles.dart';
|
||||
|
||||
enum _DialogMode { create, edit }
|
||||
|
||||
@@ -80,6 +81,11 @@ class ContainerEditScreen extends HookConsumerWidget {
|
||||
final colorScheme = theme.colorScheme;
|
||||
|
||||
final proxyOptions = ref.watch(proxyConnectionOptionsProvider);
|
||||
final proxyOptionsLoading = ref.watch(
|
||||
singboxProxyProfilesRepositoryProvider.select(
|
||||
(value) => value.isLoading && !value.hasValue,
|
||||
),
|
||||
);
|
||||
|
||||
final selectedColor = useState(initialContainer.color);
|
||||
final selectedIcon = useState(initialContainer.metadata.iconData);
|
||||
@@ -383,7 +389,11 @@ class ContainerEditScreen extends HookConsumerWidget {
|
||||
leading: const Icon(Icons.route_outlined),
|
||||
title: const Text('Proxy Connection'),
|
||||
subtitle: Text(switch (proxyConnectionId.value) {
|
||||
final id? => proxyConnectionTitle(proxyOptions, id),
|
||||
final id? => proxyConnectionTitle(
|
||||
proxyOptions,
|
||||
id,
|
||||
isLoading: proxyOptionsLoading,
|
||||
),
|
||||
null => 'None',
|
||||
}),
|
||||
trailing: const Icon(Icons.chevron_right),
|
||||
@@ -401,6 +411,12 @@ class ContainerEditScreen extends HookConsumerWidget {
|
||||
uuid.v4();
|
||||
}
|
||||
|
||||
final optionsLoaded = ref
|
||||
.read(
|
||||
singboxProxyProfilesRepositoryProvider,
|
||||
)
|
||||
.hasValue;
|
||||
|
||||
final outcome =
|
||||
await showModalBottomSheet<
|
||||
_ProxyPickerOutcome
|
||||
@@ -410,6 +426,7 @@ class ContainerEditScreen extends HookConsumerWidget {
|
||||
builder: (context) {
|
||||
return _ProxyConnectionPickerSheet(
|
||||
options: proxyOptions,
|
||||
optionsLoaded: optionsLoaded,
|
||||
selectedProxyConnectionId:
|
||||
proxyConnectionId.value,
|
||||
);
|
||||
@@ -586,10 +603,12 @@ class _ProxyPickerSelected extends _ProxyPickerOutcome {
|
||||
|
||||
class _ProxyConnectionPickerSheet extends StatelessWidget {
|
||||
final List<ProxyConnectionOption> options;
|
||||
final bool optionsLoaded;
|
||||
final ProxyConnectionId? selectedProxyConnectionId;
|
||||
|
||||
const _ProxyConnectionPickerSheet({
|
||||
required this.options,
|
||||
required this.optionsLoaded,
|
||||
required this.selectedProxyConnectionId,
|
||||
});
|
||||
|
||||
@@ -597,7 +616,8 @@ class _ProxyConnectionPickerSheet extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
final hasUnknownSelectedProxy =
|
||||
selectedProxyConnectionId != null &&
|
||||
!options.any((option) => option.id == selectedProxyConnectionId);
|
||||
optionsLoaded &&
|
||||
!proxyConnectionOptionExists(options, selectedProxyConnectionId!);
|
||||
|
||||
return SafeArea(
|
||||
child: RadioGroup<ProxyConnectionId?>(
|
||||
|
||||
+5
@@ -32,6 +32,7 @@ import 'package:weblibre/features/geckoview/features/tabs/presentation/widgets/c
|
||||
import 'package:weblibre/features/geckoview/features/tabs/utils/container_colors.dart';
|
||||
import 'package:weblibre/features/geckoview/features/tabs/utils/container_icons.dart';
|
||||
import 'package:weblibre/features/proxy/domain/providers/proxy_connection_options.dart';
|
||||
import 'package:weblibre/features/proxy/domain/repositories/singbox_proxy_profiles.dart';
|
||||
import 'package:weblibre/features/proxy/presentation/controllers/ensure_proxy_started.dart';
|
||||
import 'package:weblibre/presentation/widgets/failure_widget.dart';
|
||||
|
||||
@@ -183,6 +184,9 @@ class _ContainerCard extends HookConsumerWidget {
|
||||
final tabCount = container.tabCount ?? 0;
|
||||
final palette = ContainerColors.palette(context, containerColor);
|
||||
final proxyOptions = ref.watch(proxyConnectionOptionsProvider);
|
||||
final proxyOptionsState = ref.watch(singboxProxyProfilesRepositoryProvider);
|
||||
final proxyOptionsLoading =
|
||||
proxyOptionsState.isLoading && !proxyOptionsState.hasValue;
|
||||
|
||||
return AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 200),
|
||||
@@ -253,6 +257,7 @@ class _ContainerCard extends HookConsumerWidget {
|
||||
label: proxyConnectionTitle(
|
||||
proxyOptions,
|
||||
container.metadata.proxyConnectionId!,
|
||||
isLoading: proxyOptionsLoading,
|
||||
),
|
||||
),
|
||||
if (container.metadata.clearDataOnExit)
|
||||
|
||||
+5
@@ -35,6 +35,7 @@ import 'package:weblibre/features/geckoview/features/tabs/presentation/widgets/c
|
||||
import 'package:weblibre/features/geckoview/features/tabs/utils/container_colors.dart';
|
||||
import 'package:weblibre/features/geckoview/features/tabs/utils/container_icons.dart';
|
||||
import 'package:weblibre/features/proxy/domain/providers/proxy_connection_options.dart';
|
||||
import 'package:weblibre/features/proxy/domain/repositories/singbox_proxy_profiles.dart';
|
||||
import 'package:weblibre/presentation/widgets/failure_widget.dart';
|
||||
|
||||
class ContainerSelectionScreen extends HookConsumerWidget {
|
||||
@@ -242,6 +243,9 @@ class _SelectionContainerCard extends ConsumerWidget {
|
||||
final palette = ContainerColors.palette(context, containerColor);
|
||||
|
||||
final proxyOptions = ref.watch(proxyConnectionOptionsProvider);
|
||||
final proxyOptionsState = ref.watch(singboxProxyProfilesRepositoryProvider);
|
||||
final proxyOptionsLoading =
|
||||
proxyOptionsState.isLoading && !proxyOptionsState.hasValue;
|
||||
|
||||
return AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 200),
|
||||
@@ -315,6 +319,7 @@ class _SelectionContainerCard extends ConsumerWidget {
|
||||
label: proxyConnectionTitle(
|
||||
proxyOptions,
|
||||
container.metadata.proxyConnectionId!,
|
||||
isLoading: proxyOptionsLoading,
|
||||
),
|
||||
),
|
||||
if (container.metadata.clearDataOnExit)
|
||||
|
||||
Reference in New Issue
Block a user