File tree Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ const StateRoute = (props: StateRouteProps) => {
90
90
// if true invoke render Tree with snapshot
91
91
const renderTree = ( ) => {
92
92
if ( hierarchy ) {
93
- return < Tree snapshot = { snapshot } /> ;
93
+ return < Tree snapshot = { snapshot } snapshots = { snapshots } currLocation = { currLocation } /> ;
94
94
}
95
95
return < div className = 'noState' > { NO_STATE_MSG } </ div > ;
96
96
} ;
Original file line number Diff line number Diff line change @@ -40,21 +40,27 @@ interface TreeProps {
40
40
stateSnaphot ?: object ;
41
41
children ?: any [ ] ;
42
42
} ;
43
+ snapshots ?;
44
+ currLocation ?;
43
45
}
44
46
45
47
const Tree = ( props : TreeProps ) => {
46
- const { snapshot } = props ;
48
+ const { snapshot, snapshots , currLocation } = props ;
47
49
const [ store , dispatch ] = useStoreContext ( ) ;
48
50
49
51
useEffect ( ( ) => {
50
52
dispatch ( setCurrentTabInApp ( 'history' ) ) ;
51
53
} , [ ] ) ;
52
54
55
+ console . log ( 'props:' , props ) ;
56
+ // console.log('snapshot:', snapshot);
57
+ // console.group('store:', store);
53
58
return (
54
59
< >
55
60
{ snapshot && (
56
61
< JSONTree
57
- data = { snapshot }
62
+ data = { snapshots [ currLocation [ 'index' ] ] || snapshot }
63
+ // data={snapshot}
58
64
theme = { { extend : colors , tree : ( ) => ( { className : 'json-tree' } ) } }
59
65
shouldExpandNode = { ( ) => true }
60
66
getItemString = { getItemString }
Original file line number Diff line number Diff line change @@ -197,16 +197,17 @@ function MainContainer(): JSX.Element {
197
197
}
198
198
199
199
return (
200
- < div className = 'main-container' >
200
+ < div key = 'main' className = 'main-container' >
201
201
< div id = 'bodyContainer' className = 'body-container' >
202
202
< ActionContainer
203
+ key = 'action'
203
204
actionView = { actionView }
204
205
setActionView = { setActionView }
205
206
toggleActionContainer = { toggleActionContainer }
206
207
/>
207
208
{ snapshots . length ? handleSplit ( split ) : null }
208
- < TravelContainer snapshotsLength = { snapshots . length } />
209
- < ButtonsContainer />
209
+ < TravelContainer key = 'travel' snapshotsLength = { snapshots . length } />
210
+ < ButtonsContainer key = 'button' />
210
211
</ div >
211
212
</ div >
212
213
) ;
You can’t perform that action at this time.
0 commit comments