diff --git a/jslib b/jslib index eef9588646..2b6657a293 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit eef9588646091d268ef4c94f3d6db1412d9a99ab +Subproject commit 2b6657a293e7be107271ad080c64ccd3f005afb7 diff --git a/src/background/main.background.ts b/src/background/main.background.ts index 9e7e367784..885b94b8b2 100644 --- a/src/background/main.background.ts +++ b/src/background/main.background.ts @@ -579,7 +579,7 @@ export default class MainBackground { }); } - if (cipher == null || (cipher.login.password && cipher.login.password !== '')) { + if (cipher == null || (cipher.login.password && cipher.login.password !== '' && cipher.viewPassword)) { await this.contextMenusCreate({ type: 'normal', id: 'copy-password_' + idSuffix, diff --git a/src/popup/components/action-buttons.component.html b/src/popup/components/action-buttons.component.html index 276666fb97..54039a3057 100644 --- a/src/popup/components/action-buttons.component.html +++ b/src/popup/components/action-buttons.component.html @@ -13,7 +13,7 @@ + [ngClass]="{disabled: (!cipher.login.password || !cipher.viewPassword)}"> diff --git a/src/popup/components/action-buttons.component.ts b/src/popup/components/action-buttons.component.ts index 0401b41e33..4158564b5e 100644 --- a/src/popup/components/action-buttons.component.ts +++ b/src/popup/components/action-buttons.component.ts @@ -53,6 +53,10 @@ export class ActionButtonsComponent { return; } + if (!cipher.viewPassword) { + return; + } + this.analytics.eventTrack.next({ action: 'Copied ' + aType }); this.platformUtilsService.copyToClipboard(value, { window: window }); this.toasterService.popAsync('info', null, diff --git a/src/popup/vault/add-edit.component.html b/src/popup/vault/add-edit.component.html index bd11fca90e..bbe9906ff4 100644 --- a/src/popup/vault/add-edit.component.html +++ b/src/popup/vault/add-edit.component.html @@ -40,32 +40,36 @@
+ name="Login.Password" [(ngModel)]="cipher.login.password" appInputVerbatim + [disabled]="!cipher.viewPassword">
+ appA11yTitle="{{'toggleVisibility' | i18n}}" (click)="togglePassword()" + *ngIf="cipher.viewPassword"> + appA11yTitle="{{'generatePassword' | i18n}}" (click)="generatePassword()" + *ngIf="cipher.viewPassword">
- +
@@ -293,11 +297,13 @@ *ngIf="f.type === fieldType.Text" placeholder="{{'value' | i18n}}" appInputVerbatim> + *ngIf="f.type === fieldType.Hidden" placeholder="{{'value' | i18n}}" + [disabled]="!cipher.viewPassword && !f.newField"> -
+