From 01a41cf122385721239650ffcc086d4661523544 Mon Sep 17 00:00:00 2001 From: Alice Hernandez Date: Sun, 14 Jun 2026 21:50:38 +1000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20sessions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/components/Editor/MarkdownEditor.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/renderer/components/Editor/MarkdownEditor.tsx b/src/renderer/components/Editor/MarkdownEditor.tsx index 3bc4ac4..c43436b 100644 --- a/src/renderer/components/Editor/MarkdownEditor.tsx +++ b/src/renderer/components/Editor/MarkdownEditor.tsx @@ -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()