TF-3332 Prevent refresh when switching mailbox

This commit is contained in:
DatDang
2024-12-20 10:47:39 +07:00
committed by Dat H. Pham
parent 091d52e635
commit 85b9e49800
4 changed files with 9 additions and 4 deletions
@@ -45,6 +45,7 @@ class ThreadRepositoryImpl extends ThreadRepository {
EmailFilter? emailFilter,
Properties? propertiesCreated,
Properties? propertiesUpdated,
bool getLatestChanges = true,
}
) async* {
log('ThreadRepositoryImpl::getAllEmail(): filter = ${emailFilter?.mailboxId}');
@@ -92,7 +93,7 @@ class ThreadRepositoryImpl extends ThreadRepository {
await _updateEmailCache(accountId, session.username, newCreated: networkEmailResponse.emailList);
}
if (localEmailResponse.hasState()) {
if (localEmailResponse.hasState() && getLatestChanges) {
log('ThreadRepositoryImpl::getAllEmail(): filter = ${emailFilter?.mailboxId} local has state: ${localEmailResponse.state}');
await _synchronizeCacheWithChanges(
session,