1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-19 01:33:33 +00:00

Add copy username and copy password shortcuts (#379)

This commit is contained in:
Elias Papavasileiou
2020-02-11 05:37:25 +02:00
committed by GitHub
parent d10e562e40
commit f7037dd1f5
2 changed files with 30 additions and 1 deletions

View File

@@ -151,6 +151,18 @@ export class VaultComponent implements OnInit, OnDestroy {
case 'modalClosed':
this.showingModal = false;
break;
case 'copyUsername':
const selectedCipherU = this.cipherId != null ? this.ciphersComponent.ciphers.find(cipher => cipher.id == this.cipherId) : null;
if (selectedCipherU != null && selectedCipherU.login != null && selectedCipherU.login.username != null) {
this.copyValue(selectedCipherU.login.username, 'username');
}
break;
case 'copyPassword':
const selectedCipherP = this.cipherId != null ? this.ciphersComponent.ciphers.find(cipher => cipher.id == this.cipherId) : null;
if (selectedCipherP != null && selectedCipherP.login != null && selectedCipherP.login.password != null) {
this.copyValue(selectedCipherP.login.password, 'password');
}
break;
default:
detectChanges = false;
break;