1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-27 12:36:14 +01:00

Handle main window hide

This commit is contained in:
Chad Scharf 2020-10-29 16:35:09 -04:00
parent be95ee9328
commit d8d1ee3022
8 changed files with 33 additions and 13 deletions

2
jslib

@ -1 +1 @@
Subproject commit d84d6da7f77ec89ba69299b1ff982f083fd77203
Subproject commit 4258077179afa09f57712d2c9d05a9dff0b2f583

View File

@ -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() {

View File

@ -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);
};

View File

@ -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);
}
}

View File

@ -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() {

View File

@ -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() {

View File

@ -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);
}
}

View File

@ -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);