Skip to content

Commit b1b2ebb

Browse files
committed
fixed ts error on MainSlider
1 parent 8c71160 commit b1b2ebb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/app/components/TimeTravel/MainSlider.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const handle = (props: HandleProps): JSX.Element => {
2929

3030
function MainSlider(props: MainSliderProps): JSX.Element {
3131
const dispatch = useDispatch();
32-
const { snapshotsLength } = props; // destructure props to get our total number of snapshots
32+
const { snapshots } = props; // destructure props to get our total number of snapshots
3333
const [sliderIndex, setSliderIndex] = useState(0); // create a local state 'sliderIndex' and set it to 0.
3434
const { tabs, currentTab }: MainState = useSelector((state: RootState) => state.main);
3535
const { currLocation } = tabs[currentTab]; // we destructure the currentTab object
@@ -49,7 +49,7 @@ function MainSlider(props: MainSliderProps): JSX.Element {
4949
className='travel-slider'
5050
color='#0af548'
5151
min={0} // index of our first snapshot
52-
max={snapshotsLength - 1} // index of our last snapshot
52+
max={snapshots.length - 1} // index of our last snapshot
5353
value={sliderIndex} // currently slider thumb position
5454
onChange={(index: any) => {
5555
// when the slider position changes

0 commit comments

Comments
 (0)