perf(post): reduce draft save debounce from 2s to 500ms

Makes the draft saving feel more responsive without hammering localStorage
on every keystroke.
This commit is contained in:
Claude
2026-01-21 11:11:46 +00:00
parent cc2b6453a6
commit 2dfa58d10e

View File

@@ -234,13 +234,13 @@ export function PostViewer({ windowId }: PostViewerProps = {}) {
setIsEditorEmpty(editorRef.current.isEmpty());
}
// Debounce draft save (2 seconds)
// Debounce draft save (500ms)
if (draftSaveTimeoutRef.current) {
clearTimeout(draftSaveTimeoutRef.current);
}
draftSaveTimeoutRef.current = setTimeout(() => {
saveDraft();
}, 2000);
}, 500);
}, [saveDraft]);
// Cleanup timeout on unmount