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(collection/presentation): math equations rendering twice
Elian Doran3c5e0855d7cb
diff --git a/apps/client/src/widgets/collections/presentation/index.tsx b/apps/client/src/widgets/collections/presentation/index.tsxindex b384b02208..c25d0678fc 100644--- a/apps/client/src/widgets/collections/presentation/index.tsx+++ b/apps/client/src/widgets/collections/presentation/index.tsx@@ -10,6 +10,7 @@ import ActionButton from "../../react/ActionButton";import "./index.css";import { RefObject } from "preact";import { openInCurrentNoteContext } from "../../../components/note_context";+import { useTriliumEvent } from "../../react/hooks";const stylesheets = [slideBaseStylesheet,@@ -22,9 +23,18 @@ export default function PresentationView({ note, noteIds }: ViewModeProps<{}>) {const containerRef = useRef<HTMLDivElement>(null);const apiRef = useRef<Reveal.Api>(null);- useLayoutEffect(() => {+ function refresh() {buildPresentationModel(note).then(setPresentation);- }, [ note, noteIds ]);+ }++ useTriliumEvent("entitiesReloaded", ({ loadResults }) => {+ if (loadResults.getNoteIds().find(noteId => noteIds.includes(noteId))) {+ console.log("Needs reload!");+ refresh();+ }+ });++ useLayoutEffect(refresh, [ note, noteIds ]);return presentation && (<>diff --git a/apps/client/src/widgets/collections/presentation/slidejs.css b/apps/client/src/widgets/collections/presentation/slidejs.cssindex 6fd846f0b3..25363245ce 100644--- a/apps/client/src/widgets/collections/presentation/slidejs.css+++ b/apps/client/src/widgets/collections/presentation/slidejs.css@@ -1,4 +1,8 @@figure img {aspect-ratio: unset !important;height: auto !important;+}++[aria-hidden=true] {+ display: none !important;}\ No newline at end of file