mirror of
https://github.com/zadam/trilium.git
synced 2026-02-22 21:54:39 +01:00
chore(render): address requested changes
This commit is contained in:
parent
f4e82acc67
commit
c139ff776c
@ -37,7 +37,11 @@ async function render(note: FNote, $el: JQuery<HTMLElement>, onError?: ErrorHand
|
||||
return renderNoteIds.length > 0;
|
||||
} catch (e) {
|
||||
if (typeof e === "string" && e.startsWith("{") && e.endsWith("}")) {
|
||||
onError?.(JSON.parse(e));
|
||||
try {
|
||||
onError?.(JSON.parse(e));
|
||||
} catch (e) {
|
||||
onError?.(e);
|
||||
}
|
||||
} else {
|
||||
onError?.(e);
|
||||
}
|
||||
@ -69,7 +73,7 @@ async function renderIfJsx(bundle: Bundle, result: unknown, $el: JQuery<HTMLElem
|
||||
}
|
||||
|
||||
render() {
|
||||
if ("error" in this.state && this.state?.error) return;
|
||||
if ("error" in this.state && this.state?.error) return null;
|
||||
return this.props.children;
|
||||
}
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user