mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-12 08:27:27 +02:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user