mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
opt.: sync immediately after changes (#577)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'package:fl_lib/fl_lib.dart';
|
||||
import 'package:server_box/core/sync.dart';
|
||||
import 'package:server_box/data/model/server/private_key_info.dart';
|
||||
import 'package:server_box/data/res/store.dart';
|
||||
|
||||
@@ -18,12 +19,14 @@ class PrivateKeyProvider extends Provider {
|
||||
pkis.value.add(info);
|
||||
pkis.notify();
|
||||
Stores.key.put(info);
|
||||
bakSync.sync(milliDelay: 1000);
|
||||
}
|
||||
|
||||
static void delete(PrivateKeyInfo info) {
|
||||
pkis.value.removeWhere((e) => e.id == info.id);
|
||||
pkis.notify();
|
||||
Stores.key.delete(info);
|
||||
bakSync.sync(milliDelay: 1000);
|
||||
}
|
||||
|
||||
static void update(PrivateKeyInfo old, PrivateKeyInfo newInfo) {
|
||||
@@ -37,5 +40,6 @@ class PrivateKeyProvider extends Provider {
|
||||
Stores.key.put(newInfo);
|
||||
}
|
||||
pkis.notify();
|
||||
bakSync.sync(milliDelay: 1000);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user