1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-21 10:43:35 +00:00

[PM-12045] search service activeuserstate (#13035)

* removing activeuserstate from search service
This commit is contained in:
Jason Ng
2025-03-06 12:26:24 -05:00
committed by GitHub
parent 9761588a2a
commit f65daf7284
19 changed files with 159 additions and 637 deletions

View File

@@ -15,6 +15,8 @@ import {
} from "rxjs";
import { SearchService } from "@bitwarden/common/abstractions/search.service";
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
import { getUserId } from "@bitwarden/common/auth/services/account.service";
import { SendView } from "@bitwarden/common/tools/send/models/view/send.view";
import { SendService } from "@bitwarden/common/tools/send/services/send.service.abstraction";
@@ -71,9 +73,13 @@ export class SendItemsService {
/**
* Observable that indicates whether a filter is currently applied to the sends.
*/
hasFilterApplied$ = combineLatest([this._searchText$, this.sendListFiltersService.filters$]).pipe(
switchMap(([searchText, filters]) => {
return from(this.searchService.isSearchable(searchText)).pipe(
hasFilterApplied$ = combineLatest([
this._searchText$,
this.sendListFiltersService.filters$,
getUserId(this.accountService.activeAccount$),
]).pipe(
switchMap(([searchText, filters, activeAcctId]) => {
return from(this.searchService.isSearchable(activeAcctId, searchText)).pipe(
map(
(isSearchable) =>
isSearchable || Object.values(filters).some((filter) => filter !== null),
@@ -98,6 +104,7 @@ export class SendItemsService {
private sendService: SendService,
private sendListFiltersService: SendListFiltersService,
private searchService: SearchService,
private accountService: AccountService,
) {}
applyFilter(newSearchText: string) {