diff --git a/lib/data/repository/config_options_store.dart b/lib/data/repository/config_options_store.dart index 96d3476f..16234849 100644 --- a/lib/data/repository/config_options_store.dart +++ b/lib/data/repository/config_options_store.dart @@ -123,6 +123,31 @@ List rules(RulesRef ref) => switch (ref.watch(regionNotifierProvider)) { _ => [], }; +@riverpod +ConfigOptions configPreferences(ConfigPreferencesRef ref) { + return ConfigOptions( + executeConfigAsIs: kDebugMode && _debugConfigBuilder, + logLevel: ref.watch(logLevelStore), + resolveDestination: ref.watch(resolveDestinationStore), + ipv6Mode: ref.watch(ipv6ModeStore), + remoteDnsAddress: ref.watch(remoteDnsAddressStore), + remoteDnsDomainStrategy: ref.watch(remoteDnsDomainStrategyStore), + directDnsAddress: ref.watch(directDnsAddressStore), + directDnsDomainStrategy: ref.watch(directDnsDomainStrategyStore), + mixedPort: ref.watch(mixedPortStore), + localDnsPort: ref.watch(localDnsPortStore), + tunImplementation: ref.watch(tunImplementationStore), + mtu: ref.watch(mtuStore), + connectionTestUrl: ref.watch(connectionTestUrlStore), + urlTestInterval: ref.watch(urlTestIntervalStore), + enableClashApi: ref.watch(enableClashApiStore), + clashApiPort: ref.watch(clashApiPortStore), + enableTun: ref.watch(enableTunStore), + setSystemProxy: ref.watch(setSystemProxyStore), + rules: ref.watch(rulesProvider), + ); +} + @riverpod ConfigOptions configOptions(ConfigOptionsRef ref) { final mode = ref.watch(coreModeStoreProvider); diff --git a/lib/features/settings/view/config_options_page.dart b/lib/features/settings/view/config_options_page.dart index c9ec6717..a1994f13 100644 --- a/lib/features/settings/view/config_options_page.dart +++ b/lib/features/settings/view/config_options_page.dart @@ -18,7 +18,7 @@ class ConfigOptionsPage extends HookConsumerWidget { Widget build(BuildContext context, WidgetRef ref) { final t = ref.watch(translationsProvider); - final options = ref.watch(configOptionsProvider); + final options = ref.watch(configPreferencesProvider); return Scaffold( appBar: AppBar(