Avoid running js when empty

pull/12129/head
Henry Heino 2025-04-17 15:57:08 -07:00
parent 39d3319252
commit 19194c9a23
1 changed files with 3 additions and 1 deletions

View File

@ -440,7 +440,9 @@ function NoteEditor(props: Props, ref: any) {
isFirstScrollRef.current = false;
return;
}
webviewRef.current?.injectJS(jumpToHashJs);
if (jumpToHashJs && webviewRef.current) {
webviewRef.current.injectJS(jumpToHashJs);
}
}, [jumpToHashJs]);
const html = useHtml(css);