Remove closeBox when open box in hive database

Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
dab246
2025-05-30 10:08:02 +07:00
committed by Dat H. Pham
parent 19cede1a5f
commit 02c2e08e40
12 changed files with 11 additions and 45 deletions
@@ -76,13 +76,11 @@ class NewEmailCacheManager {
EmailId emailId
) async {
final keyCache = TupleKey(emailId.asString, accountId.asString, userName.value).encodeKey;
final detailedEmailCache = await _cacheClient.getItem(keyCache, needToReopen: true);
final detailedEmailCache = await _cacheClient.getItem(keyCache);
if (detailedEmailCache != null) {
return detailedEmailCache;
} else {
throw NotFoundStoredNewEmailException();
}
}
Future<void> closeNewEmailHiveCacheBox() => _cacheClient.closeBox();
}
@@ -74,7 +74,7 @@ class OpenedEmailCacheManager {
EmailId emailId
) async {
final keyCache = TupleKey(emailId.asString, accountId.asString, userName.value).encodeKey;
final detailedEmailCache = await _cacheClient.getItem(keyCache, needToReopen: true);
final detailedEmailCache = await _cacheClient.getItem(keyCache);
if (detailedEmailCache != null) {
return detailedEmailCache;
} else {