Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking โ€œSign up for GitHubโ€, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PM-16133] - [Vault] Implement persistence on filters in Vault view #13303

Merged
merged 12 commits into from
Feb 24, 2025
Prev Previous commit
Next Next commit
fix type error
  • Loading branch information
jaasen-livefront committed Feb 13, 2025
commit 242fa1666a25a05d52ae539b8d7eca1c66535cc0
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@ import {
combineLatest,
debounceTime,
distinctUntilChanged,
filter,
map,
Observable,
of,
@@ -30,6 +31,7 @@ import {
StateProvider,
VAULT_SETTINGS_DISK,
} from "@bitwarden/common/platform/state";
import { UserId } from "@bitwarden/common/types/guid";
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
import { FolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction";
import { CipherType } from "@bitwarden/common/vault/enums";
@@ -349,16 +351,15 @@ export class VaultPopupListFiltersService {
* Folder array structured to be directly passed to `ChipSelectComponent`
*/
folders$: Observable<ChipSelectOption<FolderView>[]> = this.activeUserId$.pipe(
filter((userId): userId is UserId => userId !== null),
switchMap((userId) => {
// Observable of cipher views
const cipherViews$ = userId
? this.cipherService.cipherViews$(userId).pipe(
tap((cipherViews) => {
this.cipherViews = Object.values(cipherViews);
}),
map((ciphers) => Object.values(ciphers)),
)
: [];
const cipherViews$ = this.cipherService.cipherViews$(userId).pipe(
tap((cipherViews) => {
this.cipherViews = Object.values(cipherViews);
}),
map((ciphers) => Object.values(ciphers)),
);

return combineLatest([
this.filters$.pipe(
Loading