Merge branch 'fix/android-image-picker-patch' of https://github.com/haileyok/social-app into haileyok-fix/android-image-picker-patch
This commit is contained in:
commit
bb17d2d23b
2 changed files with 1349 additions and 1 deletions
1343
patches/expo-image-picker+14.7.1.patch
Normal file
1343
patches/expo-image-picker+14.7.1.patch
Normal file
File diff suppressed because it is too large
Load diff
|
@ -4,6 +4,7 @@ import {
|
||||||
MediaTypeOptions,
|
MediaTypeOptions,
|
||||||
} from 'expo-image-picker'
|
} from 'expo-image-picker'
|
||||||
import {getDataUriSize} from './util'
|
import {getDataUriSize} from './util'
|
||||||
|
import * as Toast from 'view/com/util/Toast'
|
||||||
|
|
||||||
export async function openPicker(opts?: ImagePickerOptions) {
|
export async function openPicker(opts?: ImagePickerOptions) {
|
||||||
const response = await launchImageLibraryAsync({
|
const response = await launchImageLibraryAsync({
|
||||||
|
@ -13,7 +14,11 @@ export async function openPicker(opts?: ImagePickerOptions) {
|
||||||
...opts,
|
...opts,
|
||||||
})
|
})
|
||||||
|
|
||||||
return (response.assets ?? []).map(image => ({
|
if (response.assets && response.assets.length > 4) {
|
||||||
|
Toast.show('You may only select up to 4 images')
|
||||||
|
}
|
||||||
|
|
||||||
|
return (response.assets ?? []).slice(0, 4).map(image => ({
|
||||||
mime: 'image/jpeg',
|
mime: 'image/jpeg',
|
||||||
height: image.height,
|
height: image.height,
|
||||||
width: image.width,
|
width: image.width,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue