2018-01-24 04:21:14 +01:00
|
|
|
import * as template from './view.component.html';
|
|
|
|
|
|
|
|
import {
|
|
|
|
Component,
|
|
|
|
Input,
|
|
|
|
OnChanges,
|
|
|
|
} from '@angular/core';
|
|
|
|
|
2018-01-24 06:06:05 +01:00
|
|
|
import { CipherService } from 'jslib/abstractions/cipher.service';
|
|
|
|
|
2018-01-24 04:21:14 +01:00
|
|
|
@Component({
|
|
|
|
selector: 'app-vault-view',
|
|
|
|
template: template,
|
|
|
|
})
|
|
|
|
export class ViewComponent implements OnChanges {
|
|
|
|
@Input() cipherId: string;
|
2018-01-24 06:06:05 +01:00
|
|
|
cipher: any;
|
2018-01-24 04:21:14 +01:00
|
|
|
|
2018-01-24 06:06:05 +01:00
|
|
|
constructor(private cipherService: CipherService) {
|
2018-01-24 04:21:14 +01:00
|
|
|
}
|
|
|
|
|
2018-01-24 06:06:05 +01:00
|
|
|
async ngOnChanges() {
|
|
|
|
const cipher = await this.cipherService.get(this.cipherId);
|
|
|
|
this.cipher = await cipher.decrypt();
|
2018-01-24 04:21:14 +01:00
|
|
|
}
|
|
|
|
}
|