Skip to content

Commit 772c613

Browse files
committed
Apply enhancement velopert#85
Autosave even when postId does not exist (title must be valid & markdown length > 30)
1 parent 10c96a0 commit 772c613

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/containers/write/MarkdownEditorContainer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,8 @@ const MarkdownEditorContainer: React.FC<MarkdownEditorContainerProps> = () => {
239239
const changed = !shallowEqual(lastSavedData, { title, body: markdown });
240240
if (changed) {
241241
const timeoutId = setTimeout(() => {
242-
if (!postId) return;
243-
onTempSave();
242+
if (!postId && !title && markdown.length < 30) return;
243+
onTempSave(true);
244244
}, 10 * 1000);
245245

246246
return () => {

0 commit comments

Comments
 (0)