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
@@ -52,12 +52,8 @@ abstract class HiveCacheClient<T> {
});
}
Future<T?> getItem(String key, {bool needToReopen = false}) {
log('$runtimeType::getItem() key: $encryption - needToReopen: $needToReopen');
Future<T?> getItem(String key) {
return Future.sync(() async {
if (needToReopen) {
await closeBox();
}
final boxItem = encryption
? await openBoxEncryption()
: await openBox();