diff --git a/src/app/vault/add-edit.component.ts b/src/app/vault/add-edit.component.ts
index ebc3d93b03..6b834f22e9 100644
--- a/src/app/vault/add-edit.component.ts
+++ b/src/app/vault/add-edit.component.ts
@@ -3,7 +3,9 @@ import {
NgZone,
OnChanges,
OnDestroy,
+ ViewChild
} from '@angular/core';
+import { NgForm } from '@angular/forms';
import { AuditService } from 'jslib/abstractions/audit.service';
import { CipherService } from 'jslib/abstractions/cipher.service';
@@ -21,6 +23,7 @@ import { BroadcasterService } from 'jslib/angular/services/broadcaster.service';
import { AddEditComponent as BaseAddEditComponent } from 'jslib/angular/components/add-edit.component';
+
const BroadcasterSubscriptionId = 'AddEditComponent';
@Component({
@@ -28,6 +31,8 @@ const BroadcasterSubscriptionId = 'AddEditComponent';
templateUrl: 'add-edit.component.html',
})
export class AddEditComponent extends BaseAddEditComponent implements OnChanges, OnDestroy {
+ @ViewChild('form')
+ private form: NgForm;
constructor(cipherService: CipherService, folderService: FolderService,
i18nService: I18nService, platformUtilsService: PlatformUtilsService,
auditService: AuditService, stateService: StateService,
@@ -84,4 +89,8 @@ export class AddEditComponent extends BaseAddEditComponent implements OnChanges,
return (!this.editMode || this.cloneMode) && this.ownershipOptions
&& (this.ownershipOptions.length > 1 || !this.allowPersonal);
}
+
+ markPasswordAsDirty() {
+ this.form.controls['Login.Password'].markAsDirty();
+ }
}
diff --git a/src/app/vault/vault.component.ts b/src/app/vault/vault.component.ts
index 3d9513fdbb..c0af15560b 100644
--- a/src/app/vault/vault.component.ts
+++ b/src/app/vault/vault.component.ts
@@ -554,6 +554,7 @@ export class VaultComponent implements OnInit, OnDestroy {
this.modal.close();
if (this.addEditComponent != null && this.addEditComponent.cipher != null &&
this.addEditComponent.cipher.type === CipherType.Login && this.addEditComponent.cipher.login != null) {
+ this.addEditComponent.markPasswordAsDirty();
this.addEditComponent.cipher.login.password = password;
}
});
From 7bed3b0b59c9698d9d03a295708616219dd12acd Mon Sep 17 00:00:00 2001
From: Chad Griffis <16548994+gryffs@users.noreply.github.com>
Date: Sat, 1 May 2021 16:44:40 +0800
Subject: [PATCH 2/2] Update a formatting issue with markPasswordAsDirty
---
src/app/vault/add-edit.component.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/app/vault/add-edit.component.ts b/src/app/vault/add-edit.component.ts
index 6b834f22e9..97d15d59a1 100644
--- a/src/app/vault/add-edit.component.ts
+++ b/src/app/vault/add-edit.component.ts
@@ -92,5 +92,5 @@ export class AddEditComponent extends BaseAddEditComponent implements OnChanges,
markPasswordAsDirty() {
this.form.controls['Login.Password'].markAsDirty();
- }
+ }
}