From 5254c5ae590f19efff8a50f7b0602b8307d2ba02 Mon Sep 17 00:00:00 2001 From: Vincent Salucci <26154748+vincentsalucci@users.noreply.github.com> Date: Wed, 19 Feb 2020 13:59:38 -0600 Subject: [PATCH] Added missed clone mode conditionals and fixed add/edit state bug (#385) --- src/app/vault/add-edit.component.html | 7 ++++--- src/app/vault/add-edit.component.ts | 7 ++++++- src/app/vault/vault.component.ts | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/app/vault/add-edit.component.html b/src/app/vault/add-edit.component.html index 090a9895d7..546906fc94 100644 --- a/src/app/vault/add-edit.component.html +++ b/src/app/vault/add-edit.component.html @@ -237,12 +237,13 @@ + (click)="attachments()" *ngIf="editMode && !cloneMode" role="button">
{{'attachments' | i18n}}
+ (click)="editCollections()" *ngIf="editMode && !cloneMode && cipher.organizationId" + role="button">
{{'collections' | i18n}}
@@ -361,4 +362,4 @@ - + \ No newline at end of file diff --git a/src/app/vault/add-edit.component.ts b/src/app/vault/add-edit.component.ts index 4e32f94ed6..e9fecda9de 100644 --- a/src/app/vault/add-edit.component.ts +++ b/src/app/vault/add-edit.component.ts @@ -36,6 +36,11 @@ export class AddEditComponent extends BaseAddEditComponent implements OnChanges async ngOnChanges() { await super.init(); - await super.load(); + await this.load(); + } + + async load() { + this.cipher = null; + super.load(); } } diff --git a/src/app/vault/vault.component.ts b/src/app/vault/vault.component.ts index d06ad1d4ea..ef28bb59c3 100644 --- a/src/app/vault/vault.component.ts +++ b/src/app/vault/vault.component.ts @@ -611,7 +611,7 @@ export class VaultComponent implements OnInit, OnDestroy { } private dirtyInput(): boolean { - return (this.action === 'add' || this.action === 'edit') && + return (this.action === 'add' || this.action === 'edit' || this.action === 'clone') && document.querySelectorAll('app-vault-add-edit .ng-dirty').length > 0; }