bitwarden-estensione-browser/src/popup/vault/attachments.component.ts

49 lines
1.8 KiB
TypeScript
Raw Normal View History

2018-04-11 19:51:09 +02:00
import { Location } from '@angular/common';
import { Component } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
2018-04-11 19:51:09 +02:00
import { first } from 'rxjs/operators';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { CipherService } from 'jslib-common/abstractions/cipher.service';
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { UserService } from 'jslib-common/abstractions/user.service';
2018-04-11 19:51:09 +02:00
import { AttachmentsComponent as BaseAttachmentsComponent } from 'jslib-angular/components/attachments.component';
2018-04-11 19:51:09 +02:00
@Component({
selector: 'app-vault-attachments',
templateUrl: 'attachments.component.html',
})
export class AttachmentsComponent extends BaseAttachmentsComponent {
openedAttachmentsInPopup: boolean;
constructor(cipherService: CipherService, i18nService: I18nService,
2018-08-29 15:26:43 +02:00
cryptoService: CryptoService, userService: UserService,
platformUtilsService: PlatformUtilsService, apiService: ApiService, private location: Location,
private route: ActivatedRoute, logService: LogService) {
super(cipherService, i18nService, cryptoService, userService, platformUtilsService, apiService, window,
logService);
2018-04-11 19:51:09 +02:00
}
async ngOnInit() {
this.route.queryParams.pipe(first()).subscribe(async params => {
2018-04-11 19:51:09 +02:00
this.cipherId = params.cipherId;
2019-03-06 20:31:50 +01:00
await this.init();
2018-04-11 19:51:09 +02:00
});
this.openedAttachmentsInPopup = history.length === 1;
2018-04-11 19:51:09 +02:00
}
back() {
this.location.back();
}
close() {
window.close();
2018-04-11 19:51:09 +02:00
}
}