1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 17:23:37 +00:00

[Soft Delete] - cipher search rem deleted flag, filter array conditional

This commit is contained in:
Chad Scharf
2020-04-08 16:44:13 -04:00
parent 549fcc18ff
commit 3a10c1ff30
5 changed files with 63 additions and 20 deletions

View File

@@ -64,7 +64,7 @@ export class CiphersComponent {
async refresh() {
try {
this.refreshing = true;
await this.reload(this.filter);
await this.reload(this.filter, this.deleted);
} finally {
this.refreshing = false;
}
@@ -80,14 +80,15 @@ export class CiphersComponent {
if (this.searchTimeout != null) {
clearTimeout(this.searchTimeout);
}
const deletedFilter: (cipher: CipherView) => boolean = (c) => c.isDeleted === this.deleted;
if (timeout == null) {
this.ciphers = await this.searchService.searchCiphers(this.searchText, this.filter, null, this.deleted);
this.ciphers = await this.searchService.searchCiphers(this.searchText, [this.filter, deletedFilter], null);
await this.resetPaging();
return;
}
this.searchPending = true;
this.searchTimeout = setTimeout(async () => {
this.ciphers = await this.searchService.searchCiphers(this.searchText, this.filter, null, this.deleted);
this.ciphers = await this.searchService.searchCiphers(this.searchText, [this.filter, deletedFilter], null);
await this.resetPaging();
this.searchPending = false;
}, timeout);