fix(ribbon): wrong default view type in search

This commit is contained in:
Elian Doran 2025-10-20 18:03:55 +03:00
parent 6d09c7116f
commit b224267e3b
No known key found for this signature in database

View File

@ -25,7 +25,8 @@ const VIEW_TYPE_MAPPINGS: Record<ViewTypeOptions, string> = {
export default function CollectionPropertiesTab({ note }: TabContext) {
const [ viewType, setViewType ] = useNoteLabel(note, "viewType");
const viewTypeWithDefault = (viewType ?? "grid") as ViewTypeOptions;
const defaultViewType = (note?.type === "search" ? "list" : "grid");
const viewTypeWithDefault = (viewType ?? defaultViewType) as ViewTypeOptions;
const properties = bookPropertiesConfig[viewTypeWithDefault].properties;
return (