adds rangeStart undefined check
This commit is contained in:
Abhinav 2022-01-13 14:18:00 +05:30
parent 24c3551b5c
commit 6516246499

View file

@ -310,7 +310,7 @@ const PhotoFrame = ({
};
const handleRangeSelect = (index: number) => () => {
if (rangeStart !== index) {
if (typeof rangeStart !== 'undefined' && rangeStart !== index) {
const direction =
(index - rangeStart) / Math.abs(index - rangeStart);
let checked = true;