Lock sync during sign in to prevent possible race condition

This commit is contained in:
Mo Bitar
2018-05-16 10:33:55 -05:00
parent c043c8a08f
commit ac73904d32
2 changed files with 30 additions and 5 deletions

View File

@@ -193,8 +193,21 @@ class SyncManager {
this.$interval.cancel(this.syncStatus.checker);
}
lockSyncing() {
this.syncLocked = true;
}
unlockSyncing() {
this.syncLocked = false;
}
sync(callback, options = {}, source) {
if(this.syncLocked) {
console.log("Sync Locked, Returning;");
return;
}
if(!options) options = {};
if(typeof callback == 'string') {