mirror of
https://github.com/bitwarden/browser
synced 2025-12-13 23:03:32 +00:00
[PM-12045] search service activeuserstate (#13035)
* removing activeuserstate from search service
This commit is contained in:
@@ -27,6 +27,7 @@ export class VaultItemsComponent implements OnInit, OnDestroy {
|
||||
|
||||
protected searchPending = false;
|
||||
|
||||
private userId: UserId;
|
||||
private destroy$ = new Subject<void>();
|
||||
private searchTimeout: any = null;
|
||||
private isSearchable: boolean = false;
|
||||
@@ -44,10 +45,12 @@ export class VaultItemsComponent implements OnInit, OnDestroy {
|
||||
protected accountService: AccountService,
|
||||
) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
async ngOnInit() {
|
||||
this.userId = await firstValueFrom(getUserId(this.accountService.activeAccount$));
|
||||
|
||||
this._searchText$
|
||||
.pipe(
|
||||
switchMap((searchText) => from(this.searchService.isSearchable(searchText))),
|
||||
switchMap((searchText) => from(this.searchService.isSearchable(this.userId, searchText))),
|
||||
takeUntil(this.destroy$),
|
||||
)
|
||||
.subscribe((isSearchable) => {
|
||||
@@ -133,6 +136,7 @@ export class VaultItemsComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
this.ciphers = await this.searchService.searchCiphers(
|
||||
this.userId,
|
||||
this.searchText,
|
||||
[this.filter, this.deletedFilter],
|
||||
indexedCiphers,
|
||||
|
||||
Reference in New Issue
Block a user