diff --git a/jslib b/jslib index d84d6da7..42580771 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit d84d6da7f77ec89ba69299b1ff982f083fd77203 +Subproject commit 4258077179afa09f57712d2c9d05a9dff0b2f583 diff --git a/src/app/accounts/lock.component.ts b/src/app/accounts/lock.component.ts index 33b6d5ae..657c0110 100644 --- a/src/app/accounts/lock.component.ts +++ b/src/app/accounts/lock.component.ts @@ -17,6 +17,8 @@ import { VaultTimeoutService } from 'jslib/abstractions/vaultTimeout.service'; import { LockComponent as BaseLockComponent } from 'jslib/angular/components/lock.component'; +import { BroadcasterService } from 'jslib/angular/services/broadcaster.service'; + @Component({ selector: 'app-lock', templateUrl: 'lock.component.html', @@ -27,9 +29,10 @@ export class LockComponent extends BaseLockComponent { userService: UserService, cryptoService: CryptoService, storageService: StorageService, vaultTimeoutService: VaultTimeoutService, environmentService: EnvironmentService, stateService: StateService, - apiService: ApiService, private route: ActivatedRoute) { + apiService: ApiService, broadcasterService: BroadcasterService, + private route: ActivatedRoute) { super(router, i18nService, platformUtilsService, messagingService, userService, cryptoService, - storageService, vaultTimeoutService, environmentService, stateService, apiService); + storageService, vaultTimeoutService, environmentService, stateService, apiService, broadcasterService); } async ngOnInit() { diff --git a/src/app/accounts/login.component.ts b/src/app/accounts/login.component.ts index 1b06d85b..8fb75c7a 100644 --- a/src/app/accounts/login.component.ts +++ b/src/app/accounts/login.component.ts @@ -22,6 +22,8 @@ import { SyncService } from 'jslib/abstractions/sync.service'; import { LoginComponent as BaseLoginComponent } from 'jslib/angular/components/login.component'; import { ModalComponent } from 'jslib/angular/components/modal.component'; +import { BroadcasterService } from 'jslib/angular/services/broadcaster.service'; + @Component({ selector: 'app-login', templateUrl: 'login.component.html', @@ -35,9 +37,10 @@ export class LoginComponent extends BaseLoginComponent { syncService: SyncService, private componentFactoryResolver: ComponentFactoryResolver, platformUtilsService: PlatformUtilsService, stateService: StateService, environmentService: EnvironmentService, passwordGenerationService: PasswordGenerationService, - cryptoFunctionService: CryptoFunctionService, storageService: StorageService) { + cryptoFunctionService: CryptoFunctionService, storageService: StorageService, + broadcasterService: BroadcasterService) { super(authService, router, platformUtilsService, i18nService, stateService, environmentService, - passwordGenerationService, cryptoFunctionService, storageService); + passwordGenerationService, cryptoFunctionService, broadcasterService, storageService); super.onSuccessfulLogin = () => { return syncService.fullSync(true); }; diff --git a/src/app/accounts/register.component.ts b/src/app/accounts/register.component.ts index 19fa0c19..c6910fe1 100644 --- a/src/app/accounts/register.component.ts +++ b/src/app/accounts/register.component.ts @@ -9,6 +9,8 @@ import { PasswordGenerationService } from 'jslib/abstractions/passwordGeneration import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service'; import { StateService } from 'jslib/abstractions/state.service'; +import { BroadcasterService } from 'jslib/angular/services/broadcaster.service'; + import { RegisterComponent as BaseRegisterComponent } from 'jslib/angular/components/register.component'; @Component({ @@ -19,8 +21,9 @@ export class RegisterComponent extends BaseRegisterComponent { constructor(authService: AuthService, router: Router, i18nService: I18nService, cryptoService: CryptoService, apiService: ApiService, stateService: StateService, - platformUtilsService: PlatformUtilsService, passwordGenerationService: PasswordGenerationService) { + platformUtilsService: PlatformUtilsService, passwordGenerationService: PasswordGenerationService, + broadcasterService: BroadcasterService) { super(authService, router, i18nService, cryptoService, apiService, stateService, platformUtilsService, - passwordGenerationService); + passwordGenerationService, broadcasterService); } } diff --git a/src/app/accounts/set-password.component.ts b/src/app/accounts/set-password.component.ts index 295ded43..0e9a9b3e 100644 --- a/src/app/accounts/set-password.component.ts +++ b/src/app/accounts/set-password.component.ts @@ -15,6 +15,8 @@ import { PolicyService } from 'jslib/abstractions/policy.service'; import { SyncService } from 'jslib/abstractions/sync.service'; import { UserService } from 'jslib/abstractions/user.service'; +import { BroadcasterService } from 'jslib/angular/services/broadcaster.service'; + import { SetPasswordComponent as BaseSetPasswordComponent, } from 'jslib/angular/components/set-password.component'; @@ -28,9 +30,9 @@ export class SetPasswordComponent extends BaseSetPasswordComponent { cryptoService: CryptoService, messagingService: MessagingService, userService: UserService, passwordGenerationService: PasswordGenerationService, platformUtilsService: PlatformUtilsService, policyService: PolicyService, router: Router, - syncService: SyncService, route: ActivatedRoute) { + syncService: SyncService, route: ActivatedRoute, broadcasterService: BroadcasterService) { super(i18nService, cryptoService, messagingService, userService, passwordGenerationService, - platformUtilsService, policyService, router, apiService, syncService, route); + platformUtilsService, policyService, router, apiService, syncService, route, broadcasterService); } get masterPasswordScoreWidth() { diff --git a/src/app/vault/add-edit.component.ts b/src/app/vault/add-edit.component.ts index ed0d529d..937dfbfd 100644 --- a/src/app/vault/add-edit.component.ts +++ b/src/app/vault/add-edit.component.ts @@ -16,6 +16,8 @@ import { UserService } from 'jslib/abstractions/user.service'; import { AddEditComponent as BaseAddEditComponent } from 'jslib/angular/components/add-edit.component'; +import { BroadcasterService } from 'jslib/angular/services/broadcaster.service'; + @Component({ selector: 'app-vault-add-edit', templateUrl: 'add-edit.component.html', @@ -25,9 +27,10 @@ export class AddEditComponent extends BaseAddEditComponent implements OnChanges i18nService: I18nService, platformUtilsService: PlatformUtilsService, auditService: AuditService, stateService: StateService, userService: UserService, collectionService: CollectionService, - messagingService: MessagingService, eventService: EventService) { + messagingService: MessagingService, eventService: EventService, + broadcasterService: BroadcasterService) { super(cipherService, folderService, i18nService, platformUtilsService, auditService, stateService, - userService, collectionService, messagingService, eventService); + userService, collectionService, messagingService, eventService, broadcasterService); } async ngOnInit() { diff --git a/src/app/vault/export.component.ts b/src/app/vault/export.component.ts index eac41c80..1fb5d0c7 100644 --- a/src/app/vault/export.component.ts +++ b/src/app/vault/export.component.ts @@ -8,6 +8,8 @@ import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service'; import { ExportComponent as BaseExportComponent } from 'jslib/angular/components/export.component'; +import { BroadcasterService } from 'jslib/angular/services/broadcaster.service'; + @Component({ selector: 'app-export', templateUrl: 'export.component.html', @@ -15,7 +17,8 @@ import { ExportComponent as BaseExportComponent } from 'jslib/angular/components export class ExportComponent extends BaseExportComponent { constructor(cryptoService: CryptoService, i18nService: I18nService, platformUtilsService: PlatformUtilsService, exportService: ExportService, - eventService: EventService) { - super(cryptoService, i18nService, platformUtilsService, exportService, eventService, window); + eventService: EventService, broadcasterService: BroadcasterService) { + super(cryptoService, i18nService, platformUtilsService, exportService, eventService, window, + broadcasterService); } } diff --git a/src/main.ts b/src/main.ts index e582c4cf..49317e07 100644 --- a/src/main.ts +++ b/src/main.ts @@ -149,6 +149,9 @@ export class Main { event.preventDefault(); this.processDeepLink([url]); }); + + // Handle visibility event(s) + this.windowMain.win.on('hide', () => this.messagingService.send('hideMain')); }, (e: any) => { // tslint:disable-next-line console.error(e);