Skip to content

Commit

Permalink
save every second
Browse files Browse the repository at this point in the history
  • Loading branch information
samlhuillier committed Dec 20, 2023
1 parent 7eb5499 commit 2737760
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/File/MarkdownEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const MarkdownEditor: React.FC<MarkdownEditorProps> = ({
useEffect(() => {
const saveInterval = setInterval(() => {
saveFile();
}, 5000); // Every 10 seconds
}, 1000); // Every 1 second

return () => clearInterval(saveInterval); // Clear the interval when component unmounts
}, [content]); // Dependency on content ensures saveFile has the latest content
Expand Down

0 comments on commit 2737760

Please sign in to comment.