mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-27 17:18:04 +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:
parent
de1d26bd8d
commit
ec13cfd70c
@ -80,8 +80,16 @@ export default class ContextMenusBackground {
|
||||
return;
|
||||
}
|
||||
|
||||
const ciphers = await this.cipherService.getAllDecrypted();
|
||||
const cipher = ciphers.find(c => c.id === id);
|
||||
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();
|
||||
cipher = ciphers.find(c => c.id === id);
|
||||
}
|
||||
|
||||
if (cipher == null) {
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user