@@ -36,13 +36,13 @@ import {
36
36
} from '../types/callbacks' ;
37
37
import { isMultiValued , stringifyId , isMultiOutputProp } from './dependencies' ;
38
38
import { urlBase } from './utils' ;
39
- import { getCSRFHeader , dispatchError } from '.' ;
39
+ import { getCSRFHeader , dispatchError , setPaths } from '.' ;
40
40
import { createAction , Action } from 'redux-actions' ;
41
41
import { addHttpHeaders } from '../actions' ;
42
42
import { notifyObservers , updateProps } from './index' ;
43
43
import { CallbackJobPayload } from '../reducers/callbackJobs' ;
44
44
import { handlePatch , isPatch } from './patch' ;
45
- import { getPath } from './paths' ;
45
+ import { computePaths , getPath } from './paths' ;
46
46
47
47
import { requestDependencies } from './requestDependencies' ;
48
48
@@ -51,6 +51,7 @@ import {loadLibrary} from '../utils/libraries';
51
51
import { parsePMCId } from './patternMatching' ;
52
52
import { replacePMC } from './patternMatching' ;
53
53
import { loaded , loading } from './loading' ;
54
+ import { getComponentLayout } from '../wrapper/wrapping' ;
54
55
55
56
export const addBlockedCallbacks = createAction < IBlockedCallback [ ] > (
56
57
CallbackActionType . AddBlocked
@@ -409,7 +410,25 @@ function sideUpdate(outputs: SideUpdateOutput, cb: ICallbackPayload) {
409
410
return acc ;
410
411
} , [ ] as any [ ] )
411
412
. forEach ( ( [ id , idProps ] ) => {
413
+ const state = getState ( ) ;
412
414
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
+ ) ;
413
432
} ) ;
414
433
} ;
415
434
}
0 commit comments