Add images to the post in the right order
parent
bccc8a64d0
commit
61682d5846
|
@ -44,7 +44,7 @@ export const PhotoCarouselPicker = ({
|
||||||
...IMAGE_PARAMS,
|
...IMAGE_PARAMS,
|
||||||
})
|
})
|
||||||
const img = await compressIfNeeded(cameraRes, 300000)
|
const img = await compressIfNeeded(cameraRes, 300000)
|
||||||
onSelectPhotos([img.path, ...selectedPhotos])
|
onSelectPhotos([...selectedPhotos, img.path])
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
// ignore
|
// ignore
|
||||||
store.log.warn('Error using camera', err)
|
store.log.warn('Error using camera', err)
|
||||||
|
@ -68,7 +68,7 @@ export const PhotoCarouselPicker = ({
|
||||||
height,
|
height,
|
||||||
})
|
})
|
||||||
const img = await compressIfNeeded(cropperRes, 300000)
|
const img = await compressIfNeeded(cropperRes, 300000)
|
||||||
onSelectPhotos([img.path, ...selectedPhotos])
|
onSelectPhotos([...selectedPhotos, img.path])
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
// ignore
|
// ignore
|
||||||
store.log.warn('Error selecting photo', err)
|
store.log.warn('Error selecting photo', err)
|
||||||
|
@ -102,7 +102,7 @@ export const PhotoCarouselPicker = ({
|
||||||
const finalImg = await compressIfNeeded(cropperRes, 300000)
|
const finalImg = await compressIfNeeded(cropperRes, 300000)
|
||||||
result.push(finalImg.path)
|
result.push(finalImg.path)
|
||||||
}
|
}
|
||||||
onSelectPhotos([...result, ...selectedPhotos])
|
onSelectPhotos([...selectedPhotos, ...result])
|
||||||
})
|
})
|
||||||
}, [selectedPhotos, onSelectPhotos])
|
}, [selectedPhotos, onSelectPhotos])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue