Skip to content

Commit 65f1b40

Browse files
committed
feat(frontend): remove hidden collections from all filters
1 parent b60ef00 commit 65f1b40

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

apps/frontend/app/components/common.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,7 @@ export const CollectionsFilter = (props: {
508508
collections?: string[];
509509
invertCollection?: boolean;
510510
}) => {
511+
const userDetails = useUserDetails();
511512
const collections = useUserCollections();
512513
const [_, { setP }] = useAppSearchParam(props.cookieName);
513514

@@ -516,18 +517,25 @@ export const CollectionsFilter = (props: {
516517
flex={1}
517518
clearable
518519
searchable
519-
rightSectionWidth={rem(100)}
520520
rightSectionPointerEvents="all"
521521
defaultValue={props.collections}
522522
placeholder="Select a collection"
523+
rightSectionWidth={rem(100)}
523524
onChange={(v) => setP("collections", v.join(","))}
524525
data={[
525526
{
526527
group: "My collections",
527-
items: collections.map((c) => ({
528-
value: c.id.toString(),
529-
label: c.name,
530-
})),
528+
items: collections
529+
.filter(
530+
(c) =>
531+
c.collaborators.find(
532+
(c) => c.collaborator.id === userDetails.id,
533+
)?.extraInformation?.isHidden !== true,
534+
)
535+
.map((c) => ({
536+
label: c.name,
537+
value: c.id.toString(),
538+
})),
531539
},
532540
]}
533541
rightSection={

0 commit comments

Comments
 (0)