mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-03-04 03:56:33 +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._db = db;
|
||||||
this._imap = imap;
|
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
|
// If we haven't set any syncState at all, let's set it for the first time
|
||||||
// to generate a delta for N1
|
// to generate a delta for N1
|
||||||
if (_.isEmpty(this._folder.syncState)) {
|
if (_.isEmpty(this._folder.syncState)) {
|
||||||
|
@ -517,14 +524,6 @@ class FetchMessagesInFolderIMAP extends SyncTask {
|
||||||
failedUIDs: [],
|
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._fetchUnsyncedMessages();
|
||||||
yield this._fetchMessageAttributeChanges();
|
yield this._fetchMessageAttributeChanges();
|
||||||
console.log(`🔚 📂 ${this._folder.name} done`)
|
console.log(`🔚 📂 ${this._folder.name} done`)
|
||||||
|
|
Loading…
Reference in a new issue