Skip to content

Commit 890bf75

Browse files
authored
Merge pull request #571 from velopert/fix/write-post
feat: Add isPrivate, isTemp flag
2 parents 4c9e0fc + 7dd8c1a commit 890bf75

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/containers/write/MarkdownEditorContainer.tsx

+5-4
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ const MarkdownEditorContainer: React.FC<MarkdownEditorContainerProps> = () => {
5959
initialBody,
6060
initialTitle,
6161
tags,
62+
isPrivate,
6263
} = useSelector((state: RootState) => state.write);
6364
const uncachedClient = useUncachedApolloClient();
6465
const [writePost, { loading: isWritePostLoading }] =
@@ -193,8 +194,8 @@ const MarkdownEditorContainer: React.FC<MarkdownEditorContainerProps> = () => {
193194
title,
194195
body: markdown,
195196
is_markdown: true,
196-
is_temp: true,
197-
is_private: false,
197+
is_temp: isTemp,
198+
is_private: isPrivate,
198199
url_slug: escapeForUrl(title),
199200
thumbnail: null,
200201
meta: {},
@@ -233,7 +234,6 @@ const MarkdownEditorContainer: React.FC<MarkdownEditorContainerProps> = () => {
233234
dispatch,
234235
editPost,
235236
history,
236-
isTemp,
237237
lastSavedData,
238238
markdown,
239239
postId,
@@ -242,6 +242,7 @@ const MarkdownEditorContainer: React.FC<MarkdownEditorContainerProps> = () => {
242242
writePost,
243243
isWritePostLoading,
244244
isEditPostLoading,
245+
isTemp,
245246
],
246247
);
247248

@@ -310,7 +311,7 @@ const MarkdownEditorContainer: React.FC<MarkdownEditorContainerProps> = () => {
310311
const timeoutId = setTimeout(() => {
311312
if (!postId && !title && markdown.length < 30) return;
312313
onTempSave(true);
313-
}, 10 * 1000);
314+
}, 1000 * 10);
314315

315316
return () => {
316317
clearTimeout(timeoutId);

0 commit comments

Comments
 (0)