mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-21 15:56:10 +08:00
Fix bug where sync could spawn twice
This commit is contained in:
parent
2b9e96fc72
commit
f0401a7ba1
|
@ -200,13 +200,6 @@ export default class MailsyncBridge {
|
|||
return;
|
||||
}
|
||||
|
||||
if (fullAccountJSON.syncState !== Account.SYNC_STATE_OK) {
|
||||
Actions.updateAccount(id, {
|
||||
syncState: Account.SYNC_STATE_OK,
|
||||
syncError: null,
|
||||
});
|
||||
}
|
||||
|
||||
const client = new MailsyncProcess(NylasEnv.getLoadSettings(), identity, fullAccountJSON);
|
||||
client.sync();
|
||||
client.on('deltas', this._onIncomingMessages);
|
||||
|
@ -232,6 +225,14 @@ export default class MailsyncBridge {
|
|||
}
|
||||
});
|
||||
this._clients[id] = client;
|
||||
|
||||
if (fullAccountJSON.syncState !== Account.SYNC_STATE_OK) {
|
||||
// note: This call triggers ensureClients, and must go after this.clients[id] is set
|
||||
Actions.updateAccount(id, {
|
||||
syncState: Account.SYNC_STATE_OK,
|
||||
syncError: null,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
_onQueueTask(task) {
|
||||
|
|
Loading…
Reference in a new issue