|
|
|
|
@ -319,46 +319,23 @@ export class Fido2Component implements OnInit, OnDestroy {
@@ -319,46 +319,23 @@ export class Fido2Component implements OnInit, OnDestroy {
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async loadLoginCiphers() { |
|
|
|
|
this.ciphers = (await this.cipherService.getAllDecrypted()).filter( |
|
|
|
|
(cipher) => cipher.type === CipherType.Login && !cipher.isDeleted |
|
|
|
|
); |
|
|
|
|
if (!this.hasLoadedAllCiphers) { |
|
|
|
|
this.hasLoadedAllCiphers = !this.searchService.isSearchable(this.searchText); |
|
|
|
|
} |
|
|
|
|
await this.search(null); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async search(timeout: number = null) { |
|
|
|
|
this.searchPending = false; |
|
|
|
|
if (this.searchTimeout != null) { |
|
|
|
|
clearTimeout(this.searchTimeout); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (timeout == null) { |
|
|
|
|
this.hasSearched = this.searchService.isSearchable(this.searchText); |
|
|
|
|
protected async search() { |
|
|
|
|
this.hasSearched = this.searchService.isSearchable(this.searchText); |
|
|
|
|
this.searchPending = true; |
|
|
|
|
if (this.hasSearched) { |
|
|
|
|
this.displayedCiphers = await this.searchService.searchCiphers( |
|
|
|
|
this.searchText, |
|
|
|
|
null, |
|
|
|
|
this.ciphers |
|
|
|
|
); |
|
|
|
|
return; |
|
|
|
|
} else { |
|
|
|
|
const equivalentDomains = this.settingsService.getEquivalentDomains(this.url); |
|
|
|
|
this.displayedCiphers = this.ciphers.filter((cipher) => |
|
|
|
|
cipher.login.matchesUri(this.url, equivalentDomains) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
this.searchPending = true; |
|
|
|
|
this.searchTimeout = setTimeout(async () => { |
|
|
|
|
this.hasSearched = this.searchService.isSearchable(this.searchText); |
|
|
|
|
if (!this.hasLoadedAllCiphers && !this.hasSearched) { |
|
|
|
|
await this.loadLoginCiphers(); |
|
|
|
|
} else { |
|
|
|
|
this.displayedCiphers = await this.searchService.searchCiphers( |
|
|
|
|
this.searchText, |
|
|
|
|
null, |
|
|
|
|
this.ciphers |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
this.searchPending = false; |
|
|
|
|
this.selectedPasskey(this.displayedCiphers[0]); |
|
|
|
|
}, timeout); |
|
|
|
|
this.searchPending = false; |
|
|
|
|
this.selectedPasskey(this.displayedCiphers[0]); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
abort(fallback: boolean) { |
|
|
|
|
|