From 5ecb26b032bec09ae50338e9b36e5c605e34bd1e Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Sat, 9 Jun 2018 13:29:30 -0400 Subject: [PATCH] refresh list if attachments change --- jslib | 2 +- src/app/vault/vault.component.ts | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/jslib b/jslib index fe3a8785422..7b05416d556 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit fe3a8785422a8866dbcb91d31db6d3fd2aa2daaa +Subproject commit 7b05416d556c6041e638ec5fcb58a060062cda84 diff --git a/src/app/vault/vault.component.ts b/src/app/vault/vault.component.ts index 84bb38821b5..0d8799068fe 100644 --- a/src/app/vault/vault.component.ts +++ b/src/app/vault/vault.component.ts @@ -136,9 +136,16 @@ export class VaultComponent implements OnInit { const childComponent = this.modal.show(AttachmentsComponent, this.attachmentsModalRef); childComponent.cipherId = cipher.id; + let madeAttachmentChanges = false; + childComponent.onUploadedAttachment.subscribe(() => madeAttachmentChanges = true); + childComponent.onDeletedAttachment.subscribe(() => madeAttachmentChanges = true); - this.modal.onClosed.subscribe(() => { + this.modal.onClosed.subscribe(async () => { this.modal = null; + if (madeAttachmentChanges) { + await this.ciphersComponent.refresh(); + } + madeAttachmentChanges = false; }); }