Close hive boxes in Background (notificaiton)

This commit is contained in:
Dat PHAM HOANG
2024-07-16 16:15:31 +07:00
committed by Dat H. Pham
parent 7b5c0d5a75
commit adaab2198d
6 changed files with 47 additions and 16 deletions
@@ -28,7 +28,7 @@ class AccountCacheManager {
log('AccountCacheManager::setCurrentAccount(): $newAccount');
final newAccountCache = newAccount.toCache();
final allAccounts = await _accountCacheClient.getAll();
log('AccountCacheManager::setCurrentAccount::allAccounts(): $allAccounts');
log('AccountCacheManager::setCurrentAccount::allAccounts(): length: ${allAccounts.length}, $allAccounts');
if (allAccounts.isNotEmpty) {
final newAllAccounts = allAccounts
.unselected()
@@ -47,4 +47,6 @@ class AccountCacheManager {
log('AccountCacheManager::deleteCurrentAccount(): $hashId');
return _accountCacheClient.deleteItem(hashId);
}
Future<void> closeAccountHiveCacheBox() => _accountCacheClient.closeBox();
}