Fix config preferences

This commit is contained in:
problematicconsumer
2023-11-10 14:52:36 +03:30
parent 267e7d5648
commit 1ffe64b653
2 changed files with 26 additions and 1 deletions

View File

@@ -123,6 +123,31 @@ List<Rule> 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 @riverpod
ConfigOptions configOptions(ConfigOptionsRef ref) { ConfigOptions configOptions(ConfigOptionsRef ref) {
final mode = ref.watch(coreModeStoreProvider); final mode = ref.watch(coreModeStoreProvider);

View File

@@ -18,7 +18,7 @@ class ConfigOptionsPage extends HookConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) { Widget build(BuildContext context, WidgetRef ref) {
final t = ref.watch(translationsProvider); final t = ref.watch(translationsProvider);
final options = ref.watch(configOptionsProvider); final options = ref.watch(configPreferencesProvider);
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(