add basic routing options, auto update routing assets,use ruleset, remove geo assets
This commit is contained in:
@@ -15,16 +15,13 @@ class ConfigOptionNotifier extends _$ConfigOptionNotifier with AppLogger {
|
||||
@override
|
||||
Future<bool> build() async {
|
||||
final serviceRunning = await ref.watch(serviceRunningProvider.future);
|
||||
final serviceSingboxOptions =
|
||||
ref.read(connectionRepositoryProvider).configOptionsSnapshot;
|
||||
final serviceSingboxOptions = ref.read(connectionRepositoryProvider).configOptionsSnapshot;
|
||||
ref.listen(
|
||||
ConfigOptions.singboxConfigOptions,
|
||||
(previous, next) async {
|
||||
if (!serviceRunning || serviceSingboxOptions == null) return;
|
||||
if (next case AsyncData(:final value) when next != previous) {
|
||||
if (_lastUpdate == null ||
|
||||
DateTime.now().difference(_lastUpdate!) >
|
||||
const Duration(milliseconds: 100)) {
|
||||
if (_lastUpdate == null || DateTime.now().difference(_lastUpdate!) > const Duration(milliseconds: 100)) {
|
||||
_lastUpdate = DateTime.now();
|
||||
state = AsyncData(value != serviceSingboxOptions);
|
||||
}
|
||||
@@ -63,8 +60,7 @@ class ConfigOptionNotifier extends _$ConfigOptionNotifier with AppLogger {
|
||||
|
||||
Future<bool> importFromClipboard() async {
|
||||
try {
|
||||
final input =
|
||||
await Clipboard.getData("text/plain").then((value) => value?.text);
|
||||
final input = await Clipboard.getData("text/plain").then((value) => value?.text);
|
||||
if (input == null) return false;
|
||||
if (jsonDecode(input) case final Map<String, dynamic> map) {
|
||||
for (final option in ConfigOptions.preferences.entries) {
|
||||
|
||||
Reference in New Issue
Block a user