From efa3ba902dda6bc4a08ae2a5e4641c2427036930 Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Sun, 2 Jan 2022 18:09:28 +0700 Subject: [PATCH] removed nodeSetCurrent --- src/redux/node/actions.ts | 5 ----- src/redux/node/constants.ts | 1 - src/redux/node/handlers.ts | 5 ----- src/redux/node/sagas.ts | 8 +------- 4 files changed, 1 insertion(+), 18 deletions(-) diff --git a/src/redux/node/actions.ts b/src/redux/node/actions.ts index 544f884f..5ff2a6b6 100644 --- a/src/redux/node/actions.ts +++ b/src/redux/node/actions.ts @@ -29,11 +29,6 @@ export const nodeSetLoadingComments = (is_loading_comments: INodeState['is_loadi type: NODE_ACTIONS.SET_LOADING_COMMENTS, }); -export const nodeSetCurrent = (current: INodeState['current']) => ({ - current, - type: NODE_ACTIONS.SET_CURRENT, -}); - export const nodePostLocalComment = ( nodeId: INode['id'], comment: IComment, diff --git a/src/redux/node/constants.ts b/src/redux/node/constants.ts index aad93140..0fa9204c 100644 --- a/src/redux/node/constants.ts +++ b/src/redux/node/constants.ts @@ -36,7 +36,6 @@ export const NODE_ACTIONS = { SET_LOADING: `${prefix}SET_LOADING`, SET_LOADING_COMMENTS: `${prefix}SET_LOADING_COMMENTS`, SET_SENDING_COMMENT: `${prefix}SET_SENDING_COMMENT`, - SET_CURRENT: `${prefix}SET_CURRENT`, POST_LOCAL_COMMENT: `${prefix}POST_LOCAL_COMMENT`, SET_COMMENTS: `${prefix}SET_COMMENTS`, diff --git a/src/redux/node/handlers.ts b/src/redux/node/handlers.ts index 1d86e87f..fddfcc9e 100644 --- a/src/redux/node/handlers.ts +++ b/src/redux/node/handlers.ts @@ -4,7 +4,6 @@ import { nodeSet, nodeSetComments, nodeSetCoverImage, - nodeSetCurrent, nodeSetLoading, nodeSetLoadingComments, nodeSetSendingComment, @@ -24,9 +23,6 @@ const setLoadingComments = ( { is_loading_comments }: ReturnType ) => assocPath(['is_loading_comments'], is_loading_comments, state); -const setCurrent = (state: INodeState, { current }: ReturnType) => - assocPath(['current'], current, state); - const setSendingComment = ( state: INodeState, { is_sending_comment }: ReturnType @@ -44,7 +40,6 @@ export const NODE_HANDLERS = { [NODE_ACTIONS.SET]: setData, [NODE_ACTIONS.SET_LOADING]: setLoading, [NODE_ACTIONS.SET_LOADING_COMMENTS]: setLoadingComments, - [NODE_ACTIONS.SET_CURRENT]: setCurrent, [NODE_ACTIONS.SET_SENDING_COMMENT]: setSendingComment, [NODE_ACTIONS.SET_COMMENTS]: setComments, [NODE_ACTIONS.SET_COVER_IMAGE]: setCoverImage, diff --git a/src/redux/node/sagas.ts b/src/redux/node/sagas.ts index 1db3352e..e3182306 100644 --- a/src/redux/node/sagas.ts +++ b/src/redux/node/sagas.ts @@ -8,7 +8,6 @@ import { nodePostLocalComment, nodeSet, nodeSetComments, - nodeSetCurrent, nodeSetLoadingComments, } from './actions'; import { apiGetNodeComments, apiLockComment, apiPostComment } from './api'; @@ -25,10 +24,6 @@ export function* updateNodeEverywhere(node) { const flow_nodes: ReturnType = yield select(selectFlowNodes); - if (id === node.id) { - yield put(nodeSetCurrent(node)); - } - yield put( flowSetNodes( flow_nodes @@ -38,11 +33,10 @@ export function* updateNodeEverywhere(node) { ); } -function* onNodeGoto({ id, node_type }: ReturnType) { +function* onNodeGoto({ id }: ReturnType) { if (!id) { return; } - if (node_type) yield put(nodeSetCurrent({ ...EMPTY_NODE, type: node_type })); yield put(nodeLoadNode(id)); }