From 097fa3b307b61ddfab86c8d189950c99f3c96b85 Mon Sep 17 00:00:00 2001 From: violet-dev Date: Sun, 5 Nov 2023 09:55:50 +0900 Subject: [PATCH] db: reload instance after switching --- lib/pages/database_download/database_download_page.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/pages/database_download/database_download_page.dart b/lib/pages/database_download/database_download_page.dart index f9116dd87..5b6f57be9 100644 --- a/lib/pages/database_download/database_download_page.dart +++ b/lib/pages/database_download/database_download_page.dart @@ -160,6 +160,8 @@ class DataBaseDownloadPageState extends State { 'databasesync', SyncManager.getLatestDB().getDateTime().toString()); await prefs.setInt('synclatest', SyncManager.getLatestDB().timestamp); + await DataBaseManager.reloadInstance(); + if (Settings.useOptimizeDatabase) { await deleteUnused(); @@ -242,6 +244,8 @@ class DataBaseDownloadPageState extends State { downloading = false; }); + await DataBaseManager.reloadInstance(); + if (Settings.useOptimizeDatabase) await deleteUnused(); await indexing();