mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-03-03 19:43:04 +08:00
[local-sync] Fix order of execution in fetch-messages-in-folder
This commit is contained in:
parent
c5453ca21b
commit
50f00e5174
1 changed files with 7 additions and 8 deletions
|
@ -506,6 +506,13 @@ class FetchMessagesInFolderIMAP extends SyncTask {
|
|||
this._db = db;
|
||||
this._imap = imap;
|
||||
|
||||
const shouldSyncFolder = yield this._shouldSyncFolder()
|
||||
if (!shouldSyncFolder) {
|
||||
console.log(`🔚 📂 ${this._folder.name} has no updates - skipping sync`)
|
||||
return;
|
||||
}
|
||||
|
||||
this._box = yield this._openMailboxAndEnsureValidity();
|
||||
// If we haven't set any syncState at all, let's set it for the first time
|
||||
// to generate a delta for N1
|
||||
if (_.isEmpty(this._folder.syncState)) {
|
||||
|
@ -517,14 +524,6 @@ class FetchMessagesInFolderIMAP extends SyncTask {
|
|||
failedUIDs: [],
|
||||
})
|
||||
}
|
||||
|
||||
const shouldSyncFolder = yield this._shouldSyncFolder()
|
||||
if (!shouldSyncFolder) {
|
||||
console.log(`🔚 📂 ${this._folder.name} has no updates - skipping sync`)
|
||||
return;
|
||||
}
|
||||
|
||||
this._box = yield this._openMailboxAndEnsureValidity();
|
||||
yield this._fetchUnsyncedMessages();
|
||||
yield this._fetchMessageAttributeChanges();
|
||||
console.log(`🔚 📂 ${this._folder.name} done`)
|
||||
|
|
Loading…
Reference in a new issue