mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
removed nodeSetCurrent
This commit is contained in:
parent
292268dbc3
commit
efa3ba902d
4 changed files with 1 additions and 18 deletions
|
@ -29,11 +29,6 @@ export const nodeSetLoadingComments = (is_loading_comments: INodeState['is_loadi
|
||||||
type: NODE_ACTIONS.SET_LOADING_COMMENTS,
|
type: NODE_ACTIONS.SET_LOADING_COMMENTS,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const nodeSetCurrent = (current: INodeState['current']) => ({
|
|
||||||
current,
|
|
||||||
type: NODE_ACTIONS.SET_CURRENT,
|
|
||||||
});
|
|
||||||
|
|
||||||
export const nodePostLocalComment = (
|
export const nodePostLocalComment = (
|
||||||
nodeId: INode['id'],
|
nodeId: INode['id'],
|
||||||
comment: IComment,
|
comment: IComment,
|
||||||
|
|
|
@ -36,7 +36,6 @@ export const NODE_ACTIONS = {
|
||||||
SET_LOADING: `${prefix}SET_LOADING`,
|
SET_LOADING: `${prefix}SET_LOADING`,
|
||||||
SET_LOADING_COMMENTS: `${prefix}SET_LOADING_COMMENTS`,
|
SET_LOADING_COMMENTS: `${prefix}SET_LOADING_COMMENTS`,
|
||||||
SET_SENDING_COMMENT: `${prefix}SET_SENDING_COMMENT`,
|
SET_SENDING_COMMENT: `${prefix}SET_SENDING_COMMENT`,
|
||||||
SET_CURRENT: `${prefix}SET_CURRENT`,
|
|
||||||
|
|
||||||
POST_LOCAL_COMMENT: `${prefix}POST_LOCAL_COMMENT`,
|
POST_LOCAL_COMMENT: `${prefix}POST_LOCAL_COMMENT`,
|
||||||
SET_COMMENTS: `${prefix}SET_COMMENTS`,
|
SET_COMMENTS: `${prefix}SET_COMMENTS`,
|
||||||
|
|
|
@ -4,7 +4,6 @@ import {
|
||||||
nodeSet,
|
nodeSet,
|
||||||
nodeSetComments,
|
nodeSetComments,
|
||||||
nodeSetCoverImage,
|
nodeSetCoverImage,
|
||||||
nodeSetCurrent,
|
|
||||||
nodeSetLoading,
|
nodeSetLoading,
|
||||||
nodeSetLoadingComments,
|
nodeSetLoadingComments,
|
||||||
nodeSetSendingComment,
|
nodeSetSendingComment,
|
||||||
|
@ -24,9 +23,6 @@ const setLoadingComments = (
|
||||||
{ is_loading_comments }: ReturnType<typeof nodeSetLoadingComments>
|
{ is_loading_comments }: ReturnType<typeof nodeSetLoadingComments>
|
||||||
) => assocPath(['is_loading_comments'], is_loading_comments, state);
|
) => assocPath(['is_loading_comments'], is_loading_comments, state);
|
||||||
|
|
||||||
const setCurrent = (state: INodeState, { current }: ReturnType<typeof nodeSetCurrent>) =>
|
|
||||||
assocPath(['current'], current, state);
|
|
||||||
|
|
||||||
const setSendingComment = (
|
const setSendingComment = (
|
||||||
state: INodeState,
|
state: INodeState,
|
||||||
{ is_sending_comment }: ReturnType<typeof nodeSetSendingComment>
|
{ is_sending_comment }: ReturnType<typeof nodeSetSendingComment>
|
||||||
|
@ -44,7 +40,6 @@ export const NODE_HANDLERS = {
|
||||||
[NODE_ACTIONS.SET]: setData,
|
[NODE_ACTIONS.SET]: setData,
|
||||||
[NODE_ACTIONS.SET_LOADING]: setLoading,
|
[NODE_ACTIONS.SET_LOADING]: setLoading,
|
||||||
[NODE_ACTIONS.SET_LOADING_COMMENTS]: setLoadingComments,
|
[NODE_ACTIONS.SET_LOADING_COMMENTS]: setLoadingComments,
|
||||||
[NODE_ACTIONS.SET_CURRENT]: setCurrent,
|
|
||||||
[NODE_ACTIONS.SET_SENDING_COMMENT]: setSendingComment,
|
[NODE_ACTIONS.SET_SENDING_COMMENT]: setSendingComment,
|
||||||
[NODE_ACTIONS.SET_COMMENTS]: setComments,
|
[NODE_ACTIONS.SET_COMMENTS]: setComments,
|
||||||
[NODE_ACTIONS.SET_COVER_IMAGE]: setCoverImage,
|
[NODE_ACTIONS.SET_COVER_IMAGE]: setCoverImage,
|
||||||
|
|
|
@ -8,7 +8,6 @@ import {
|
||||||
nodePostLocalComment,
|
nodePostLocalComment,
|
||||||
nodeSet,
|
nodeSet,
|
||||||
nodeSetComments,
|
nodeSetComments,
|
||||||
nodeSetCurrent,
|
|
||||||
nodeSetLoadingComments,
|
nodeSetLoadingComments,
|
||||||
} from './actions';
|
} from './actions';
|
||||||
import { apiGetNodeComments, apiLockComment, apiPostComment } from './api';
|
import { apiGetNodeComments, apiLockComment, apiPostComment } from './api';
|
||||||
|
@ -25,10 +24,6 @@ export function* updateNodeEverywhere(node) {
|
||||||
|
|
||||||
const flow_nodes: ReturnType<typeof selectFlowNodes> = yield select(selectFlowNodes);
|
const flow_nodes: ReturnType<typeof selectFlowNodes> = yield select(selectFlowNodes);
|
||||||
|
|
||||||
if (id === node.id) {
|
|
||||||
yield put(nodeSetCurrent(node));
|
|
||||||
}
|
|
||||||
|
|
||||||
yield put(
|
yield put(
|
||||||
flowSetNodes(
|
flowSetNodes(
|
||||||
flow_nodes
|
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) {
|
if (!id) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (node_type) yield put(nodeSetCurrent({ ...EMPTY_NODE, type: node_type }));
|
|
||||||
|
|
||||||
yield put(nodeLoadNode(id));
|
yield put(nodeLoadNode(id));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue