@@ -36,13 +36,13 @@ import {
3636} from '../types/callbacks' ;
3737import { isMultiValued , stringifyId , isMultiOutputProp } from './dependencies' ;
3838import { urlBase } from './utils' ;
39- import { getCSRFHeader , dispatchError } from '.' ;
39+ import { getCSRFHeader , dispatchError , setPaths } from '.' ;
4040import { createAction , Action } from 'redux-actions' ;
4141import { addHttpHeaders } from '../actions' ;
4242import { notifyObservers , updateProps } from './index' ;
4343import { CallbackJobPayload } from '../reducers/callbackJobs' ;
4444import { handlePatch , isPatch } from './patch' ;
45- import { getPath } from './paths' ;
45+ import { computePaths , getPath } from './paths' ;
4646
4747import { requestDependencies } from './requestDependencies' ;
4848
@@ -51,6 +51,7 @@ import {loadLibrary} from '../utils/libraries';
5151import { parsePMCId } from './patternMatching' ;
5252import { replacePMC } from './patternMatching' ;
5353import { loaded , loading } from './loading' ;
54+ import { getComponentLayout } from '../wrapper/wrapping' ;
5455
5556export const addBlockedCallbacks = createAction < IBlockedCallback [ ] > (
5657 CallbackActionType . AddBlocked
@@ -409,7 +410,25 @@ function sideUpdate(outputs: SideUpdateOutput, cb: ICallbackPayload) {
409410 return acc ;
410411 } , [ ] as any [ ] )
411412 . forEach ( ( [ id , idProps ] ) => {
413+ const state = getState ( ) ;
412414 dispatch ( updateComponent ( id , idProps , cb ) ) ;
415+
416+ const componentPath = getPath ( state . paths , id ) ;
417+ const oldComponent = getComponentLayout ( componentPath , state ) ;
418+
419+ dispatch (
420+ setPaths (
421+ computePaths (
422+ {
423+ ...oldComponent ,
424+ props : { ...oldComponent . props , ...idProps }
425+ } ,
426+ [ ...componentPath ] ,
427+ state . paths ,
428+ state . paths . events
429+ )
430+ )
431+ ) ;
413432 } ) ;
414433 } ;
415434}
0 commit comments