web: only subscribe to note title if its generated

This commit is contained in:
Abdullah Atta
2025-06-26 10:50:34 +05:00
parent c7ef56a6eb
commit 2f13ec51f3

View File

@@ -39,9 +39,10 @@ function TitleBox(props: TitleBoxProps) {
const inputRef = useRef<HTMLTextAreaElement>(null);
const pendingChanges = useRef(false);
const sessionType = useEditorStore((store) => store.getSession(id)?.type);
const sessionTitle = useEditorStore(
(store) => store.getSession(id, ["default"])?.note.title
);
const sessionTitle = useEditorStore((store) => {
const session = store.getSession(id, ["default"]);
return session?.note.isGeneratedTitle ? session.note.title : null;
});
const { editorConfig } = useEditorConfig();
const dateFormat = useSettingsStore((store) => store.dateFormat);
const timeFormat = useSettingsStore((store) => store.timeFormat);