Cleanup
This commit is contained in:
parent
90942ae146
commit
ea27b9ed08
5 changed files with 18 additions and 20 deletions
|
@ -18,8 +18,8 @@ export class UserLocalPhotosModel {
|
|||
}
|
||||
|
||||
private async _getPhotos() {
|
||||
runInAction(() => {
|
||||
CameraRoll.getPhotos({first: 20}).then(r => {
|
||||
CameraRoll.getPhotos({first: 20}).then(r => {
|
||||
runInAction(() => {
|
||||
this.photos = r.edges
|
||||
})
|
||||
})
|
||||
|
|
|
@ -23,9 +23,14 @@ export const PhotoCarouselPicker = ({
|
|||
cropping: true,
|
||||
width: 1000,
|
||||
height: 1000,
|
||||
}).then(item => {
|
||||
setSelectedPhotos([item.path, ...selectedPhotos])
|
||||
})
|
||||
}).then(
|
||||
item => {
|
||||
setSelectedPhotos([item.path, ...selectedPhotos])
|
||||
},
|
||||
_err => {
|
||||
// ignore
|
||||
},
|
||||
)
|
||||
}, [selectedPhotos, setSelectedPhotos])
|
||||
|
||||
const handleSelectPhoto = useCallback(
|
||||
|
@ -58,14 +63,7 @@ export const PhotoCarouselPicker = ({
|
|||
})
|
||||
result.push(img.path)
|
||||
}
|
||||
setSelectedPhotos([
|
||||
// ...items.reduce(
|
||||
// (accum, cur) => accum.concat(cur.sourceURL!),
|
||||
// [] as string[],
|
||||
// ),
|
||||
...result,
|
||||
...selectedPhotos,
|
||||
])
|
||||
setSelectedPhotos([...result, ...selectedPhotos])
|
||||
})
|
||||
}, [selectedPhotos, setSelectedPhotos])
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue