fix(client/search): note IDs being calculated twice in search

This commit is contained in:
Elian Doran
2025-10-20 16:17:36 +03:00
parent e904feb179
commit 929eee1350

View File

@@ -39,7 +39,7 @@ export function SearchNoteList<T extends object>(props: Omit<NoteListProps, "isE
export function CustomNoteList<T extends object>({ note, isEnabled: shouldEnable, notePath, highlightedTokens, displayOnlyCollections, ntxId, onReady, ...restProps }: NoteListProps) {
const widgetRef = useRef<HTMLDivElement>(null);
const viewType = useNoteViewType(note);
const noteIds = useNoteIds(note, viewType, ntxId);
const noteIds = useNoteIds(shouldEnable ? note : null, viewType, ntxId);
const isFullHeight = (viewType && viewType !== "list" && viewType !== "grid");
const [ isIntersecting, setIsIntersecting ] = useState(false);
const shouldRender = (isFullHeight || isIntersecting || note?.type === "book");