Skip to content

Commit bcf6fff

Browse files
committed
fix: show toast when post api loading
1 parent 78902f9 commit bcf6fff

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

src/containers/write/MarkdownEditorContainer.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@ const MarkdownEditorContainer: React.FC<MarkdownEditorContainerProps> = () => {
230230
title,
231231
body: markdown,
232232
});
233-
notifySuccess();
234233
},
235234
[
236235
createPostHistory,

src/containers/write/PublishActionButtonsContainer.tsx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,16 @@ const PublishActionButtonsContainer: React.FC<
9090
};
9191

9292
const onPublish = async () => {
93-
if (writePostLoading) return;
93+
if (writePostLoading) {
94+
toast.info('포스트 작성 중입니다.');
95+
return;
96+
}
97+
9498
if (options.title.trim() === '') {
9599
toast.error('제목이 비어있습니다.');
96100
return;
97101
}
102+
98103
try {
99104
const response = await writePost({
100105
variables: variables,
@@ -114,7 +119,16 @@ const PublishActionButtonsContainer: React.FC<
114119
};
115120

116121
const onEdit = async () => {
117-
if (editPostLoading) return;
122+
if (editPostLoading) {
123+
toast.info('포스트 수정 중입니다.');
124+
return;
125+
}
126+
127+
if (options.title.trim() === '') {
128+
toast.error('제목이 비어있습니다.');
129+
return;
130+
}
131+
118132
try {
119133
const response = await editPost({
120134
variables: {

0 commit comments

Comments
 (0)