Fix config preferences
This commit is contained in:
@@ -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
|
||||
ConfigOptions configOptions(ConfigOptionsRef ref) {
|
||||
final mode = ref.watch(coreModeStoreProvider);
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user