Remove unnecessary prefs
This commit is contained in:
@@ -1,26 +0,0 @@
|
||||
import 'package:hiddify/core/prefs/prefs.dart';
|
||||
import 'package:hiddify/data/data_providers.dart';
|
||||
import 'package:hiddify/domain/clash/clash.dart';
|
||||
import 'package:hiddify/features/common/connectivity/connectivity_controller.dart';
|
||||
import 'package:hiddify/utils/utils.dart';
|
||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
|
||||
part 'clash_mode.g.dart';
|
||||
|
||||
@Riverpod(keepAlive: true)
|
||||
class ClashMode extends _$ClashMode with AppLogger {
|
||||
@override
|
||||
Future<TunnelMode?> build() async {
|
||||
final clash = ref.watch(coreFacadeProvider);
|
||||
if (!await ref.watch(serviceRunningProvider.future)) {
|
||||
return null;
|
||||
}
|
||||
ref.watch(prefsControllerProvider.select((value) => value.clash.mode));
|
||||
return clash.getConfigs().map((r) => r.mode).getOrElse(
|
||||
(l) {
|
||||
loggy.warning("fetching clash mode: $l");
|
||||
throw l;
|
||||
},
|
||||
).run();
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@ class WindowController extends _$WindowController
|
||||
await windowManager.waitUntilReadyToShow(
|
||||
windowOptions,
|
||||
() async {
|
||||
if (ref.read(prefsControllerProvider).general.silentStart) {
|
||||
if (ref.read(silentStartProvider)) {
|
||||
loggy.debug("silent start is enabled, hiding window");
|
||||
await windowManager.hide();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user