From 6b6ed48ce2c9cc3aa0acd86682df3f214de88896 Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Thu, 7 Nov 2019 18:40:10 +0700 Subject: [PATCH] added 404 to node loading process --- src/redux/node/sagas.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/redux/node/sagas.ts b/src/redux/node/sagas.ts index 07fd9e50..d8cd88e7 100644 --- a/src/redux/node/sagas.ts +++ b/src/redux/node/sagas.ts @@ -99,7 +99,7 @@ function* onNodeGoto({ id, node_type }: ReturnType) { function* onNodeLoad({ id }: ReturnType) { yield put(nodeSetLoading(true)); yield put(nodeSetLoadingComments(true)); - yield put(nodeSetSaveErrors({})); + // yield put(nodeSetSaveErrors({})); yield put(nodeSetCommentData(0, { ...EMPTY_COMMENT })); yield put(nodeSetRelated(null)); @@ -107,15 +107,13 @@ function* onNodeLoad({ id }: ReturnType) { data: { node, error }, } = yield call(reqWrapper, getNode, { id }); - if (error) { - yield put(nodeSetSaveErrors({ error })); + if (error || !node || !node.id) { + yield put(push(URLS.ERRORS.NOT_FOUND)); yield put(nodeSetLoading(false)); return; } - yield put(nodeSetSaveErrors({})); yield put(nodeSetCurrent(node)); - yield put(nodeSetLoading(false)); const {