TF-2310 Don't use Hive.boxExists() to avoid creating a database without an object store in hive on some browsers (Safari/Firefox)
This commit is contained in:
@@ -41,8 +41,7 @@ class MailboxCacheManager {
|
||||
await _mailboxCacheClient.updateMultipleItem(updatedCacheMailboxes);
|
||||
}
|
||||
|
||||
final mailboxCacheExist = await _mailboxCacheClient.isExistTable();
|
||||
if (destroyed?.isNotEmpty == true && mailboxCacheExist) {
|
||||
if (destroyed?.isNotEmpty == true) {
|
||||
final destroyedCacheMailboxes = destroyed!.toCacheKeyList(accountId, userName);
|
||||
await _mailboxCacheClient.deleteMultipleItem(destroyedCacheMailboxes);
|
||||
}
|
||||
|
||||
@@ -21,12 +21,7 @@ class StateCacheManager {
|
||||
}
|
||||
|
||||
Future<void> saveState(AccountId accountId, UserName userName, StateCache stateCache) async {
|
||||
final stateCacheExist = await _stateCacheClient.isExistTable();
|
||||
final stateKey = TupleKey(stateCache.type.name, accountId.asString, userName.value).encodeKey;
|
||||
if (stateCacheExist) {
|
||||
return await _stateCacheClient.updateItem(stateKey, stateCache);
|
||||
} else {
|
||||
return await _stateCacheClient.insertItem(stateKey, stateCache);
|
||||
}
|
||||
return await _stateCacheClient.insertItem(stateKey, stateCache);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user