Skip to content
Snippets Groups Projects
Commit c5fb4e61 authored by Guilhem CARRON's avatar Guilhem CARRON
Browse files

fix(imagePicker): Fix image pagination display

parent 3a6b22c7
No related branches found
No related tags found
2 merge requests!24fix(typo): écogestes + optionnel poll,!22feat: Add partners issue info
......@@ -49,7 +49,7 @@ const ImagePicker: React.FC<ImagePickerProps> = ({
user.xsrftoken
)
//Split array depending on page numbers
setpageCount(Math.ceil(images.length / imagePerPage) - 1)
setpageCount(Math.ceil(images.length / imagePerPage))
const arraySplitted = []
while (images.length) {
arraySplitted.push(images.splice(0, imagePerPage))
......@@ -95,8 +95,8 @@ const ImagePicker: React.FC<ImagePickerProps> = ({
<div className="image-picker">
{imageNames &&
imageNames !== [] &&
imageNames[currentPage] !== [] &&
imageNames[currentPage].map((imageURL) => (
imageNames[currentPage - 1] !== [] &&
imageNames[currentPage - 1].map((imageURL) => (
<SingleImage
imageURL={imageURL}
key={imageURL}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment