fix(client/search): collection rendering twice

This commit is contained in:
Elian Doran 2025-10-20 16:05:24 +03:00
parent 44c379fce1
commit e904feb179
No known key found for this signature in database
2 changed files with 6 additions and 4 deletions

View File

@ -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()) {

View File

@ -85,7 +85,7 @@ export function CustomNoteList<T extends object>({ note, isEnabled: shouldEnable
}
return (
<div ref={widgetRef} className={`note-list-widget component ${isFullHeight ? "full-height" : ""}`}>
<div ref={widgetRef} className={`note-list-widget component ${isFullHeight && isEnabled ? "full-height" : ""}`}>
{props && isEnabled && (
<div className="note-list-widget-content">
{getComponentByViewType(viewType, props)}