@@ -15,14 +15,6 @@ import { Button, Switch } from '@mui/material';
15
15
*/
16
16
17
17
// resetSlider locates the rc-slider elements on the document and resets it's style attributes
18
- const resetSlider = ( ) => {
19
- const slider = document . querySelector ( '.rc-slider-handle' ) ;
20
- const sliderTrack = document . querySelector ( '.rc-slider-track' ) ;
21
- if ( slider && sliderTrack ) {
22
- slider . setAttribute ( 'style' , 'left: 0' ) ;
23
- sliderTrack . setAttribute ( 'style' , 'width: 0' ) ;
24
- }
25
- } ;
26
18
27
19
function ActionContainer ( props : ActionContainerProps ) : JSX . Element {
28
20
const [ dropdownSelection , setDropdownSelection ] = useState ( 'TimeJump' ) ;
@@ -41,22 +33,6 @@ function ActionContainer(props: ActionContainerProps): JSX.Element {
41
33
// we create an array 'hierarchyArr' that will hold objects and numbers
42
34
const hierarchyArr : ( number | { } ) [ ] = [ ] ;
43
35
44
- /*
45
- function to traverse state from hierarchy and also getting information on display name and component name
46
-
47
- the obj parameter is an object with the following structure:
48
- {
49
- stateSnapshot: {
50
- route: any;
51
- children: any[];
52
- };
53
- name: number;
54
- branch: number;
55
- index: number;
56
- children?: [];
57
- }
58
- */
59
-
60
36
const displayArray = ( obj : Obj ) : void => {
61
37
if (
62
38
obj . stateSnapshot . children . length > 0 && // if the 'stateSnapshot' has a non-empty 'children' array
@@ -238,7 +214,7 @@ function ActionContainer(props: ActionContainerProps): JSX.Element {
238
214
variant = 'text'
239
215
onClick = { ( ) => {
240
216
dispatch ( emptySnapshots ( ) ) ; // set slider back to zero, visually
241
- resetSlider ( ) ;
217
+ dispatch ( changeSlider ( 0 ) ) ;
242
218
} }
243
219
type = 'button'
244
220
>
0 commit comments