fix(collections): no children warning missing for newly created collection

This commit is contained in:
Elian Doran 2025-11-18 08:39:11 +02:00
parent 65cc57ec03
commit c62a03c97b
No known key found for this signature in database

View File

@ -1,6 +1,6 @@
import { t } from "../../services/i18n"; import { t } from "../../services/i18n";
import Alert from "../react/Alert"; import Alert from "../react/Alert";
import { useNoteLabel, useTriliumEvent } from "../react/hooks"; import { useNoteLabelWithDefault, useTriliumEvent } from "../react/hooks";
import RawHtml from "../react/RawHtml"; import RawHtml from "../react/RawHtml";
import { TypeWidgetProps } from "./type_widget"; import { TypeWidgetProps } from "./type_widget";
import "./Book.css"; import "./Book.css";
@ -9,7 +9,7 @@ import { useEffect, useState } from "preact/hooks";
const VIEW_TYPES = [ "list", "grid" ]; const VIEW_TYPES = [ "list", "grid" ];
export default function Book({ note }: TypeWidgetProps) { export default function Book({ note }: TypeWidgetProps) {
const [ viewType ] = useNoteLabel(note, "viewType"); const [ viewType ] = useNoteLabelWithDefault(note, "viewType", "grid");
const [ shouldDisplayNoChildrenWarning, setShouldDisplayNoChildrenWarning ] = useState(false); const [ shouldDisplayNoChildrenWarning, setShouldDisplayNoChildrenWarning ] = useState(false);
function refresh() { function refresh() {