attachment events

This commit is contained in:
Kyle Spearrin 2018-06-09 13:29:07 -04:00
parent fe3a878542
commit 7b05416d55
2 changed files with 4 additions and 1 deletions

View File

@ -21,6 +21,8 @@ import { CipherView } from '../../models/view/cipherView';
export class AttachmentsComponent implements OnInit { export class AttachmentsComponent implements OnInit {
@Input() cipherId: string; @Input() cipherId: string;
@Output() onUploadedAttachment = new EventEmitter();
@Output() onDeletedAttachment = new EventEmitter();
cipher: CipherView; cipher: CipherView;
cipherDomain: Cipher; cipherDomain: Cipher;
@ -87,6 +89,7 @@ export class AttachmentsComponent implements OnInit {
this.cipher = await this.cipherDomain.decrypt(); this.cipher = await this.cipherDomain.decrypt();
this.analytics.eventTrack.next({ action: 'Added Attachment' }); this.analytics.eventTrack.next({ action: 'Added Attachment' });
this.toasterService.popAsync('success', null, this.i18nService.t('attachmentSaved')); this.toasterService.popAsync('success', null, this.i18nService.t('attachmentSaved'));
this.onUploadedAttachment.emit();
} catch { } } catch { }
// reset file input // reset file input
@ -121,6 +124,7 @@ export class AttachmentsComponent implements OnInit {
} catch { } } catch { }
this.deletePromises[attachment.id] = null; this.deletePromises[attachment.id] = null;
this.onDeletedAttachment.emit();
} }
async download(attachment: AttachmentView) { async download(attachment: AttachmentView) {

View File

@ -7,7 +7,6 @@ import { TrueFalseValueDirective } from './directives/true-false-value.directive
imports: [], imports: [],
declarations: [ declarations: [
InputVerbatimDirective, InputVerbatimDirective,
TrueFalseValueDirective,
], ],
}) })
export class DummyModule { export class DummyModule {