mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-29 18:50:07 +00:00
feat(gDriveSync): prevent multiple dialogs
This commit is contained in:
parent
7c693fcce3
commit
f3fa7e6003
2 changed files with 14 additions and 7 deletions
|
|
@ -52,7 +52,7 @@
|
|||
.run(setStartedTimes)
|
||||
.run(checkIfLatestVersion)
|
||||
.run(showWelcomeDialog)
|
||||
.run(goToWorkViewIfTasks);
|
||||
//.run(goToWorkViewIfTasks);
|
||||
|
||||
/* @ngInject */
|
||||
function configPromiseButtons(angularPromiseButtonsProvider) {
|
||||
|
|
|
|||
|
|
@ -122,10 +122,10 @@
|
|||
editable: true
|
||||
})
|
||||
.then((res) => {
|
||||
this.data.backupDocId = res.data.id;
|
||||
this.data.lastSyncToRemote = res.data.modifiedDate;
|
||||
// also needs to be updated
|
||||
this.data.lastLocalUpdate = res.data.modifiedDate;
|
||||
this.data.backupDocId = res.data.id;
|
||||
this.data.lastSyncToRemote = res.data.modifiedDate;
|
||||
// also needs to be updated
|
||||
this.data.lastLocalUpdate = res.data.modifiedDate;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -155,8 +155,13 @@
|
|||
}
|
||||
|
||||
this.autoSyncInterval = this.$interval(() => {
|
||||
console.log('GoogleDriveSync: SYNC');
|
||||
this.saveTo();
|
||||
// only sync if not in the middle of something
|
||||
if (!this.currentPromise || this.currentPromise.$$state.status === 1) {
|
||||
console.log('GoogleDriveSync: SYNC');
|
||||
this.saveTo();
|
||||
} else {
|
||||
console.log('GoogleDriveSync: SYNC OMITTED because of promise');
|
||||
}
|
||||
}, interval);
|
||||
}
|
||||
|
||||
|
|
@ -168,6 +173,7 @@
|
|||
|
||||
saveTo() {
|
||||
const defer = this.$q.defer();
|
||||
this.currentPromise = defer.promise;
|
||||
|
||||
// CREATE OR FIND
|
||||
// ---------------------------
|
||||
|
|
@ -223,6 +229,7 @@
|
|||
|
||||
loadFrom(isSkipPrompt = false) {
|
||||
const defer = this.$q.defer();
|
||||
this.currentPromise = defer.promise;
|
||||
|
||||
if (isSkipPrompt) {
|
||||
this._load().then((loadRes) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue