@@ -150,21 +150,18 @@ const MarkdownEditorContainer: React.FC<MarkdownEditorContainerProps> = () => {
150
150
151
151
const onTempSave = useCallback (
152
152
async ( notify ?: boolean ) => {
153
- console . log ( 'onTempSave' ) ;
153
+ const notifySuccess = ( ) => {
154
+ if ( ! notify ) return ;
155
+ toast . success ( '포스트가 임시저장되었습니다.' ) ;
156
+ } ;
154
157
155
158
if ( isWritePostLoading || isEditPostLoading ) return ;
156
159
if ( ! title || ! markdown ) {
157
160
toast . error ( '제목 또는 내용이 비어있습니다.' ) ;
158
161
return ;
159
162
}
160
163
161
- const notifySuccess = ( ) => {
162
- if ( ! notify ) return ;
163
- toast . success ( '포스트가 임시저장되었습니다.' ) ;
164
- } ;
165
-
166
164
if ( ! postId ) {
167
- console . log ( 'writePost' ) ;
168
165
const response = await writePost ( {
169
166
variables : {
170
167
title,
@@ -189,7 +186,7 @@ const MarkdownEditorContainer: React.FC<MarkdownEditorContainerProps> = () => {
189
186
}
190
187
191
188
// tempsaving unreleased post:
192
- if ( isTemp && postId ) {
189
+ if ( postId ) {
193
190
await editPost ( {
194
191
variables : {
195
192
id : postId ,
@@ -282,6 +279,7 @@ const MarkdownEditorContainer: React.FC<MarkdownEditorContainerProps> = () => {
282
279
dispatch ( setWritePostId ( id ) ) ;
283
280
history . replace ( `/write?id=${ id } ` ) ;
284
281
}
282
+
285
283
if ( ! id ) return ;
286
284
287
285
const url = URL . createObjectURL ( file ) ;
@@ -312,7 +310,7 @@ const MarkdownEditorContainer: React.FC<MarkdownEditorContainerProps> = () => {
312
310
313
311
const timeoutId = setTimeout ( ( ) => {
314
312
if ( ! postId && ! title && markdown . length < 30 ) return ;
315
- onTempSave ( true ) ;
313
+ onTempSave ( false ) ;
316
314
} , 1000 * 10 ) ;
317
315
318
316
return ( ) => {
0 commit comments