From 90aa7fb4cdabfb5fe9b9b3707da3bb3fe911c4b2 Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Fri, 10 Apr 2020 14:03:34 +0700 Subject: [PATCH] fixed comment submission --- src/redux/node/sagas.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/redux/node/sagas.ts b/src/redux/node/sagas.ts index 8ce5a8f5..aca5262f 100644 --- a/src/redux/node/sagas.ts +++ b/src/redux/node/sagas.ts @@ -197,7 +197,7 @@ function* onNodeLoad({ id, order = 'ASC' }: ReturnType) { return; } -function* onPostComment({ id, is_before }: ReturnType) { +function* onPostComment({ id }: ReturnType) { const { current, comment_data } = yield select(selectNode); yield put(nodeSetSendingComment(true)); @@ -218,12 +218,7 @@ function* onPostComment({ id, is_before }: ReturnType) { if (id === 0) { yield put(nodeSetCommentData(0, { ...EMPTY_COMMENT })); - - if (is_before) { - yield put(nodeSetComments([comment, ...comments])); - } else { - yield put(nodeSetComments([...comments, comment])); - } + yield put(nodeSetComments([comment, ...comments])); } else { yield put( nodeSet({