1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-06 03:33:30 +00:00

fix id logic

This commit is contained in:
jaasen-livefront
2025-10-31 16:11:26 -07:00
parent 7da57db149
commit 51e9aaf3a4
2 changed files with 4 additions and 4 deletions

View File

@@ -437,7 +437,7 @@ describe("VaultPopupListFiltersService", () => {
describe("folders$", () => {
it('returns no folders when "No Folder" is the only option', (done) => {
folderViews$.next([{ id: null, name: "No Folder" }]);
folderViews$.next([{ id: "", name: "No Folder" }]);
service.folders$.subscribe((folders) => {
expect(folders).toEqual([]);
@@ -447,7 +447,7 @@ describe("VaultPopupListFiltersService", () => {
it('moves "No Folder" to the end of the list', (done) => {
folderViews$.next([
{ id: null, name: "No Folder" },
{ id: "", name: "No Folder" },
{ id: "2345", name: "Folder 2" },
{ id: "1234", name: "Folder 1" },
]);

View File

@@ -390,7 +390,7 @@ export class VaultPopupListFiltersService {
FolderView[],
PopupCipherViewLike[],
] => {
if (folders.length === 1 && folders[0].id) {
if (folders.length === 1 && !folders[0].id) {
// Do not display folder selections when only the "no folder" option is available.
return [filters as PopupListFilter, [], cipherViews];
}
@@ -409,7 +409,7 @@ export class VaultPopupListFiltersService {
};
// Move the "no folder" option to the end of the list
arrangedFolders = [...folders.filter((f) => !f.id), updatedNoFolder];
arrangedFolders = [...folders.filter((f) => f.id), updatedNoFolder];
}
return [filters as PopupListFilter, arrangedFolders, cipherViews];
},