mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 15:19:01 +02:00
fix(collection/presentation): math equations rendering twice
This commit is contained in:
parent
f33fe4266a
commit
3c5e0855d7
@ -10,6 +10,7 @@ import ActionButton from "../../react/ActionButton";
|
|||||||
import "./index.css";
|
import "./index.css";
|
||||||
import { RefObject } from "preact";
|
import { RefObject } from "preact";
|
||||||
import { openInCurrentNoteContext } from "../../../components/note_context";
|
import { openInCurrentNoteContext } from "../../../components/note_context";
|
||||||
|
import { useTriliumEvent } from "../../react/hooks";
|
||||||
|
|
||||||
const stylesheets = [
|
const stylesheets = [
|
||||||
slideBaseStylesheet,
|
slideBaseStylesheet,
|
||||||
@ -22,9 +23,18 @@ export default function PresentationView({ note, noteIds }: ViewModeProps<{}>) {
|
|||||||
const containerRef = useRef<HTMLDivElement>(null);
|
const containerRef = useRef<HTMLDivElement>(null);
|
||||||
const apiRef = useRef<Reveal.Api>(null);
|
const apiRef = useRef<Reveal.Api>(null);
|
||||||
|
|
||||||
useLayoutEffect(() => {
|
function refresh() {
|
||||||
buildPresentationModel(note).then(setPresentation);
|
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 && (
|
return presentation && (
|
||||||
<>
|
<>
|
||||||
|
@ -1,4 +1,8 @@
|
|||||||
figure img {
|
figure img {
|
||||||
aspect-ratio: unset !important;
|
aspect-ratio: unset !important;
|
||||||
height: auto !important;
|
height: auto !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
[aria-hidden=true] {
|
||||||
|
display: none !important;
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user