From e740a5bb77625c62a95299bb54821078bd84f213 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Sat, 9 Jun 2018 13:29:23 -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 4c083eeb..7b05416d 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 4c083eeb92d599bd8b85fb88ec5d435079b79395 +Subproject commit 7b05416d556c6041e638ec5fcb58a060062cda84 diff --git a/src/app/vault/vault.component.ts b/src/app/vault/vault.component.ts index 15efdb9a..e491bdc9 100644 --- a/src/app/vault/vault.component.ts +++ b/src/app/vault/vault.component.ts @@ -334,9 +334,16 @@ export class VaultComponent implements OnInit, OnDestroy { 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; }); }