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()) { if(!this.passcodeManager.isLocked()) {
this.syncManager.sync(); this.syncManager.sync();
} }
this.$rootScope.$broadcast("window-gained-focus");
} }
desktop_windowLostFocus() { desktop_windowLostFocus() {

View File

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