File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import SwitchAppDropdown from '../components/SwitchApp';
6
6
7
7
import { emptySnapshots , changeView , changeSlider } from '../actions/actions' ;
8
8
import { useStoreContext } from '../store' ;
9
+ import { useEffect } from 'react' ;
9
10
10
11
const resetSlider = ( ) => {
11
12
const slider = document . querySelector ( '.rc-slider-handle' ) ;
@@ -17,7 +18,7 @@ const resetSlider = () => {
17
18
function ActionContainer ( props ) {
18
19
const [ { tabs, currentTab } , dispatch ] = useStoreContext ( ) ;
19
20
const { hierarchy, sliderIndex, viewIndex } = tabs [ currentTab ] ;
20
- const { toggleActionContainer, actionView } = props ;
21
+ const { toggleActionContainer, actionView, setActionView } = props ;
21
22
let actionsArr = [ ] ;
22
23
const hierarchyArr : any [ ] = [ ] ;
23
24
@@ -112,11 +113,14 @@ function ActionContainer(props) {
112
113
) ;
113
114
}
114
115
) ;
116
+ useEffect ( ( ) => {
117
+ setActionView ( true ) ;
118
+ } , [ ] ) ;
115
119
116
120
// this is not logging; the prop is not being udpdated or the component is not being re-rendered.
117
121
return (
118
122
< div id = 'action-id' className = 'action-container' >
119
- < div id = " arrow" >
123
+ < div id = ' arrow' >
120
124
< aside className = 'aside' >
121
125
< a onClick = { toggleActionContainer } className = 'toggle' >
122
126
< i > </ i >
Original file line number Diff line number Diff line change @@ -25,10 +25,13 @@ function MainContainer(): any {
25
25
const [ actionView , setActionView ] = useState ( true ) ;
26
26
//this function handles Time Jump sidebar view
27
27
const toggleActionContainer = ( ) => {
28
+ setActionView ( ! actionView ) ;
28
29
const toggleElem = document . querySelector ( 'aside' ) ;
29
30
toggleElem . classList . toggle ( 'no-aside' ) ;
30
- setActionView ( ! actionView ) ;
31
31
} ;
32
+ useEffect ( ( ) => {
33
+ setActionView ( true ) ;
34
+ } , [ ] ) ;
32
35
33
36
useEffect ( ( ) => {
34
37
// only open port once
@@ -115,7 +118,6 @@ function MainContainer(): any {
115
118
} ) ;
116
119
}
117
120
}
118
-
119
121
document . addEventListener ( 'click' , mpClickTrack ) ;
120
122
} , [ ] ) ;
121
123
@@ -191,6 +193,7 @@ function MainContainer(): any {
191
193
< div id = 'bodyContainer' className = 'body-container1' >
192
194
< ActionContainer
193
195
actionView = { actionView }
196
+ setActionView = { setActionView }
194
197
toggleActionContainer = { toggleActionContainer }
195
198
/>
196
199
{ snapshots . length ? (
You can’t perform that action at this time.
0 commit comments