fix
This commit is contained in:
parent
69df1f01d6
commit
98481820f9
@ -86,10 +86,11 @@ class Main extends Component {
|
|||||||
}
|
}
|
||||||
if (this.state.photos.length > 3){
|
if (this.state.photos.length > 3){
|
||||||
for(let i=this.state.currentImage - 1; i<=this.state.currentImage + 1; i++){
|
for(let i=this.state.currentImage - 1; i<=this.state.currentImage + 1; i++){
|
||||||
if(i < 0){
|
let j = i;
|
||||||
i += this.state.photos.length;
|
if(j < 0){
|
||||||
|
j += this.state.photos.length;
|
||||||
}
|
}
|
||||||
photos_carousel.push({'source': this.state.photos[i].original})
|
photos_carousel.push({'source': this.state.photos[j % this.state.photos.length].original})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user