Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix(collections): no children warning missing for newly created collection
Elian Doranc62a03c97b7e
diff --git a/apps/client/src/widgets/type_widgets/Book.tsx b/apps/client/src/widgets/type_widgets/Book.tsxindex 419225e8b3..b1ed94d68f 100644--- a/apps/client/src/widgets/type_widgets/Book.tsx+++ b/apps/client/src/widgets/type_widgets/Book.tsx@@ -1,6 +1,6 @@import { t } from "../../services/i18n";import Alert from "../react/Alert";-import { useNoteLabel, useTriliumEvent } from "../react/hooks";+import { useNoteLabelWithDefault, useTriliumEvent } from "../react/hooks";import RawHtml from "../react/RawHtml";import { TypeWidgetProps } from "./type_widget";import "./Book.css";@@ -9,7 +9,7 @@ import { useEffect, useState } from "preact/hooks";const VIEW_TYPES = [ "list", "grid" ];export default function Book({ note }: TypeWidgetProps) {- const [ viewType ] = useNoteLabel(note, "viewType");+ const [ viewType ] = useNoteLabelWithDefault(note, "viewType", "grid");const [ shouldDisplayNoChildrenWarning, setShouldDisplayNoChildrenWarning ] = useState(false);function refresh() {