Window gained focus event

This commit is contained in:
Mo Bitar
2018-12-20 11:07:20 -06:00
parent 8a56db377f
commit 2edeb553cc
2 changed files with 6 additions and 2 deletions

View File

@@ -83,6 +83,8 @@ class DesktopManager {
if(!this.passcodeManager.isLocked()) {
this.syncManager.sync();
}
this.$rootScope.$broadcast("window-gained-focus");
}
desktop_windowLostFocus() {

View File

@@ -148,8 +148,10 @@ class PasscodeManager {
if(isDesktopApplication()) {
// desktop only
this.$rootScope.$on("window-lost-focus", () => {
let visible = false;
this.documentVisibilityChanged(visible);
this.documentVisibilityChanged(false);
})
this.$rootScope.$on("window-gained-focus", () => {
this.documentVisibilityChanged(true);
})
} else {
// tab visibility listender, web only