1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-24 20:36:40 +07:00

removed nodeSetCurrent

This commit is contained in:
Fedor Katurov 2022-01-02 18:09:28 +07:00
parent 292268dbc3
commit efa3ba902d
4 changed files with 1 additions and 18 deletions

View file

@ -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,

View file

@ -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`,

View file

@ -4,7 +4,6 @@ import {
nodeSet,
nodeSetComments,
nodeSetCoverImage,
nodeSetCurrent,
nodeSetLoading,
nodeSetLoadingComments,
nodeSetSendingComment,
@ -24,9 +23,6 @@ const setLoadingComments = (
{ is_loading_comments }: ReturnType<typeof nodeSetLoadingComments>
) => assocPath(['is_loading_comments'], is_loading_comments, state);
const setCurrent = (state: INodeState, { current }: ReturnType<typeof nodeSetCurrent>) =>
assocPath(['current'], current, state);
const setSendingComment = (
state: INodeState,
{ is_sending_comment }: ReturnType<typeof nodeSetSendingComment>
@ -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,

View file

@ -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<typeof selectFlowNodes> = 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<typeof nodeGotoNode>) {
function* onNodeGoto({ id }: ReturnType<typeof nodeGotoNode>) {
if (!id) {
return;
}
if (node_type) yield put(nodeSetCurrent({ ...EMPTY_NODE, type: node_type }));
yield put(nodeLoadNode(id));
}