Merge pull request #2205 from ecency/nt/media-insert-fixes

Nt - Media insert fix
This commit is contained in:
Feruz M 2022-02-28 13:20:06 +02:00 committed by GitHub
commit 32904ed6a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -109,7 +109,7 @@ export const UploadsGalleryModal = forwardRef(({username, handleOnSelect, uploa
//inserts media items in post body
const _insertMedia = async (selectedIndex?:number) => {
const map = selectedIndex ? new Map([[selectedIndex, true]]) : indices;
const map = selectedIndex > -1 ? new Map([[selectedIndex, true]]) : indices;
const data = []
for (const index of map.keys()) {
@ -197,16 +197,12 @@ export const UploadsGalleryModal = forwardRef(({username, handleOnSelect, uploa
}else {
_insertMedia(index)
}
}
const thumbUrl = proxifyImageSrc(item.url, 600, 500, Platform.OS === 'ios' ? 'match' : 'webp');
return (
<TouchableOpacity onPress={_onPress}>
<TouchableOpacity onPress={_onPress} onLongPress={_onCheckPress}>
<FastImage
source={{uri:thumbUrl}}
style={styles.mediaItem}