Sync on window focus
This commit is contained in:
@@ -80,10 +80,6 @@ class DesktopManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
desktop_windowGainedFocus() {
|
desktop_windowGainedFocus() {
|
||||||
if(!this.passcodeManager.isLocked()) {
|
|
||||||
this.syncManager.sync();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$rootScope.$broadcast("window-gained-focus");
|
this.$rootScope.$broadcast("window-gained-focus");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,10 @@ const MillisecondsPerSecond = 1000;
|
|||||||
|
|
||||||
class PasscodeManager {
|
class PasscodeManager {
|
||||||
|
|
||||||
constructor($rootScope, authManager, storageManager) {
|
constructor($rootScope, authManager, storageManager, syncManager) {
|
||||||
this.authManager = authManager;
|
this.authManager = authManager;
|
||||||
this.storageManager = storageManager;
|
this.storageManager = storageManager;
|
||||||
|
this.syncManager = syncManager;
|
||||||
this.$rootScope = $rootScope;
|
this.$rootScope = $rootScope;
|
||||||
|
|
||||||
this._hasPasscode = this.storageManager.getItemSync("offlineParams", StorageManager.Fixed) != null;
|
this._hasPasscode = this.storageManager.getItemSync("offlineParams", StorageManager.Fixed) != null;
|
||||||
@@ -203,6 +204,10 @@ class PasscodeManager {
|
|||||||
// if that's the case, it needs to be locked immediately.
|
// if that's the case, it needs to be locked immediately.
|
||||||
if(this.lockAfterDate && new Date() > this.lockAfterDate && !this.isLocked()) {
|
if(this.lockAfterDate && new Date() > this.lockAfterDate && !this.isLocked()) {
|
||||||
this.lockApplication();
|
this.lockApplication();
|
||||||
|
} else {
|
||||||
|
if(!this.isLocked()) {
|
||||||
|
this.syncManager.sync();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.cancelAutoLockTimer();
|
this.cancelAutoLockTimer();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user