fix: auto reload after restoring

This commit is contained in:
lollipopkit
2023-09-24 15:53:53 +08:00
parent 4619b6ef9c
commit 7bbaa5f5ab
12 changed files with 43 additions and 35 deletions

View File

@@ -6,7 +6,7 @@ class PrivateKeyProvider extends ChangeNotifier {
List<PrivateKeyInfo> get pkis => _pkis;
late List<PrivateKeyInfo> _pkis;
void loadData() {
void load() {
_pkis = Stores.key.fetch();
}

View File

@@ -35,7 +35,7 @@ class ServerProvider extends ChangeNotifier {
Timer? _timer;
Future<void> loadLocalData() async {
Future<void> load() async {
// Issue #147
// Clear all servers because of restarting app will cause duplicate servers
_servers.clear();

View File

@@ -13,7 +13,7 @@ class SnippetProvider extends ChangeNotifier {
final _tags = <String>[];
List<String> get tags => _tags;
void loadData() {
void load() {
_snippets = Stores.snippet.fetch();
final order = Stores.setting.snippetOrder.fetch();
if (order.isNotEmpty) {

View File

@@ -2,9 +2,9 @@
class BuildData {
static const String name = "ServerBox";
static const int build = 572;
static const int build = 574;
static const String engine = "3.13.5";
static const String buildAt = "2023-09-23 11:12:55";
static const int modifications = 2;
static const String buildAt = "2023-09-24 15:49:22";
static const int modifications = 12;
static const int script = 18;
}

View File

@@ -17,4 +17,10 @@ class Providers {
static final server = locator<ServerProvider>();
static final sftp = locator<SftpProvider>();
static final snippet = locator<SnippetProvider>();
static void reload() {
key.load();
server.load();
snippet.load();
}
}