1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-28 17:27:50 +01:00

Pick first cipher matching url as no specific cipher was selected by the user when vault is locked

This commit is contained in:
Daniel James Smith 2021-10-19 16:11:48 +02:00
parent de1d26bd8d
commit ec13cfd70c
No known key found for this signature in database
GPG Key ID: 03E4BD365FF06726

View File

@ -80,8 +80,16 @@ export default class ContextMenusBackground {
return;
}
let cipher: CipherView;
if (id === 'noop') {
const ciphers = await this.cipherService.getAllDecryptedForUrl(tab.url);
cipher = ciphers.length > 0 ? ciphers[0] : null;
}
else {
const ciphers = await this.cipherService.getAllDecrypted();
const cipher = ciphers.find(c => c.id === id);
cipher = ciphers.find(c => c.id === id);
}
if (cipher == null) {
return;
}