From e904feb179cb6196f17381d4c54f710a9e3e184e Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 20 Oct 2025 16:05:24 +0300 Subject: [PATCH] fix(client/search): collection rendering twice --- apps/client/src/components/note_context.ts | 8 +++++--- apps/client/src/widgets/collections/NoteList.tsx | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/client/src/components/note_context.ts b/apps/client/src/components/note_context.ts index 79d1e148b..d4bcb1fa6 100644 --- a/apps/client/src/components/note_context.ts +++ b/apps/client/src/components/note_context.ts @@ -326,9 +326,11 @@ class NoteContext extends Component implements EventListener<"entitiesReloaded"> } // Collections must always display a note list, even if no children. - const viewType = note.getLabelValue("viewType") ?? "grid"; - if (!["list", "grid"].includes(viewType)) { - return true; + if (note.type === "book") { + const viewType = note.getLabelValue("viewType") ?? "grid"; + if (!["list", "grid"].includes(viewType)) { + return true; + } } if (!note.hasChildren()) { diff --git a/apps/client/src/widgets/collections/NoteList.tsx b/apps/client/src/widgets/collections/NoteList.tsx index 76deeeffe..e71aa09c9 100644 --- a/apps/client/src/widgets/collections/NoteList.tsx +++ b/apps/client/src/widgets/collections/NoteList.tsx @@ -85,7 +85,7 @@ export function CustomNoteList({ note, isEnabled: shouldEnable } return ( -
+
{props && isEnabled && (
{getComponentByViewType(viewType, props)}