feat(collection/presentation): react to tree changes

This commit is contained in:
Elian Doran 2025-10-15 22:29:34 +03:00
parent b1babd62aa
commit c8b7322f1e
No known key found for this signature in database

View File

@ -17,14 +17,14 @@ const stylesheets = [
slideCustomStylesheet slideCustomStylesheet
].map(stylesheet => stylesheet.replace(/:root/g, ":host")); ].map(stylesheet => stylesheet.replace(/:root/g, ":host"));
export default function PresentationView({ note }: ViewModeProps<{}>) { export default function PresentationView({ note, noteIds }: ViewModeProps<{}>) {
const [ presentation, setPresentation ] = useState<PresentationModel>(); const [ presentation, setPresentation ] = useState<PresentationModel>();
const containerRef = useRef<HTMLDivElement>(null); const containerRef = useRef<HTMLDivElement>(null);
const apiRef = useRef<Reveal.Api>(null); const apiRef = useRef<Reveal.Api>(null);
useLayoutEffect(() => { useLayoutEffect(() => {
buildPresentationModel(note).then(setPresentation); buildPresentationModel(note).then(setPresentation);
}, [ note ]); }, [ note, noteIds ]);
return presentation && ( return presentation && (
<> <>