From 47c64fee4fe3ddf2f3f04795eed4d657d71f4b4a Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Tue, 3 Dec 2019 16:14:13 +0700 Subject: [PATCH] clearing comment form on node load --- src/redux/node/sagas.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/redux/node/sagas.ts b/src/redux/node/sagas.ts index 2fe65c9a..2061efe9 100644 --- a/src/redux/node/sagas.ts +++ b/src/redux/node/sagas.ts @@ -141,9 +141,14 @@ function* onNodeLoad({ id, order = 'ASC' }: ReturnType) { related: call(reqWrapper, getNodeRelated, { id }), }); - yield put(nodeSetComments(comments || [])); - yield put(nodeSetRelated(related || [])); - yield put(nodeSetLoadingComments(false)); + yield put( + nodeSet({ + comments, + related, + is_loading_comments: false, + comment_data: { 0: { ...EMPTY_COMMENT } }, + }) + ); const { updated } = yield select(selectFlow);