diff --git a/src/redux/node/sagas.ts b/src/redux/node/sagas.ts index b3396de8..26f6c4ec 100644 --- a/src/redux/node/sagas.ts +++ b/src/redux/node/sagas.ts @@ -32,10 +32,10 @@ import { getNodeRelated, } from './api'; import { reqWrapper } from '../auth/sagas'; -import { flowSetNodes } from '../flow/actions'; +import { flowSetNodes, flowSetUpdated } from '../flow/actions'; import { ERRORS } from '~/constants/errors'; import { modalSetShown, modalShowDialog } from '../modal/actions'; -import { selectFlowNodes } from '../flow/selectors'; +import { selectFlowNodes, selectFlow } from '../flow/selectors'; import { URLS } from '~/constants/urls'; import { selectNode } from './selectors'; import { IResultWithStatus, INode } from '../types'; @@ -130,6 +130,12 @@ function* onNodeLoad({ id, node_type }: ReturnType) { yield put(nodeSetRelated(related || [])); yield put(nodeSetLoadingComments(false)); + const { updated } = yield select(selectFlow); + + if (updated.some(item => item.id === id)) { + yield put(flowSetUpdated(updated.filter(item => item.id !== id))); + } + return; }