fixed media insert bug, support for long press to select

This commit is contained in:
Nouman Tahir 2022-02-28 15:46:51 +05:00
parent 7b29fe016d
commit 4048d8e1c0

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()) {
@ -196,17 +196,13 @@ export const UploadsGalleryModal = forwardRef(({username, handleOnSelect, uploa
_onCheckPress()
}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}