TF-1010 Synchronize the cache every when the state available

This commit is contained in:
Dat PHAM HOANG
2022-10-04 17:39:10 +07:00
committed by Dat H. Pham
parent 4579199f6d
commit 3f51b2ea83
@@ -78,8 +78,11 @@ class ThreadRepositoryImpl extends ThreadRepository {
yield localEmailResponse;
}
if (localEmailResponse.hasState() && networkEmailResponse == null) {
if (localEmailResponse.hasState()) {
log('ThreadRepositoryImpl::getAllEmail(): filter = ${emailFilter?.mailboxId} local has state: ${localEmailResponse.state}');
if (networkEmailResponse != null) {
await _updateEmailCache(newCreated: networkEmailResponse.emailList);
}
await _synchronizeCacheWithChanges(
accountId,
localEmailResponse.state!,