TF-1915 SendingState of SendingEmail updates according to the work done in WorkManager when network connectivity is restored
(cherry picked from commit 744c8bc8dc8a82cb3afb75aead5a744adaae5501)
This commit is contained in:
@@ -116,7 +116,7 @@ class CachingManager {
|
||||
}
|
||||
|
||||
Future<void> _clearSendingEmailCache() async {
|
||||
final listSendingEmails = await _sendingEmailCacheManager.getAllSendingEmails();
|
||||
final listSendingEmails = await _sendingEmailCacheManager.getAllSendingEmails(needToReopen: true);
|
||||
final sendingIds = listSendingEmails.map((sendingEmail) => sendingEmail.sendingId).toSet().toList();
|
||||
if (sendingIds.isNotEmpty) {
|
||||
await Future.wait(
|
||||
|
||||
@@ -131,8 +131,12 @@ abstract class HiveCacheClient<T> {
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> deleteItem(String key) {
|
||||
Future<void> deleteItem(String key, {bool needToReopen = false}) {
|
||||
return Future.sync(() async {
|
||||
if (needToReopen) {
|
||||
await closeBox();
|
||||
}
|
||||
|
||||
final boxItem = encryption
|
||||
? await openBoxEncryption()
|
||||
: await openBox();
|
||||
|
||||
Reference in New Issue
Block a user