🐛 fix sessions

This commit is contained in:
2026-06-14 21:50:38 +10:00
parent 832d2a8964
commit 01a41cf122

View File

@@ -226,7 +226,10 @@ export function MarkdownEditor(): JSX.Element {
parent: editorRef.current
})
viewRef.current = view
const handleBlur = (): void => flushSession()
const handleBlur = (): void => {
const s = sessionRef.current
if (s && Date.now() - s.lastKeystroke >= IDLE_MS) flushSession()
}
window.addEventListener('blur', handleBlur)
return () => {
flushSession()