1
0
mirror of https://github.com/bitwarden/desktop.git synced 2024-09-21 03:01:37 +02:00
bitwarden-desktop/src/app/vault/view.component.ts

27 lines
577 B
TypeScript
Raw Normal View History

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
}
}