web: fix crash when note has no title

This commit is contained in:
Abdullah Atta
2023-12-23 15:35:07 +05:00
parent 0da883b40a
commit bc3dce6ecf

View File

@@ -61,10 +61,10 @@ function TitleBox(props: TitleBoxProps) {
);
useEffect(() => {
const { title = "" } = useStore.getState().session;
const { title } = useStore.getState().session;
if (!inputRef.current) return;
inputRef.current.value = title;
updateFontSize(title.length);
inputRef.current.value = title || "";
updateFontSize(title?.length || 0);
}, [id, updateFontSize]);
useEffect(() => {