1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 00:03:56 +00:00

support defaultMatch for getAllDecryptedForUrl

This commit is contained in:
Kyle Spearrin
2020-09-20 09:47:35 -04:00
parent 0a20face13
commit 3bf322a904
2 changed files with 9 additions and 4 deletions

View File

@@ -328,7 +328,8 @@ export class CipherService implements CipherServiceAbstraction {
});
}
async getAllDecryptedForUrl(url: string, includeOtherTypes?: CipherType[]): Promise<CipherView[]> {
async getAllDecryptedForUrl(url: string, includeOtherTypes?: CipherType[],
defaultMatch: UriMatchType = null): Promise<CipherView[]> {
if (url == null && includeOtherTypes == null) {
return Promise.resolve([]);
}
@@ -354,9 +355,11 @@ export class CipherService implements CipherServiceAbstraction {
const matchingDomains = result[0];
const ciphers = result[1];
let defaultMatch = await this.storageService.get<UriMatchType>(ConstantsService.defaultUriMatch);
if (defaultMatch == null) {
defaultMatch = UriMatchType.Domain;
defaultMatch = await this.storageService.get<UriMatchType>(ConstantsService.defaultUriMatch);
if (defaultMatch == null) {
defaultMatch = UriMatchType.Domain;
}
}
return ciphers.filter((cipher) => {