|
@@ -192,7 +192,8 @@ const GroupChatScreen = ({ route }: { route: any }) => {
|
|
|
id: -1,
|
|
|
filename: file.type,
|
|
|
filetype: file.type,
|
|
|
- attachment_link: file.uri
|
|
|
+ attachment_link: file.uri,
|
|
|
+ attachment_full_url: file.uri
|
|
|
},
|
|
|
pending: true,
|
|
|
isSending: true,
|
|
@@ -242,15 +243,7 @@ const GroupChatScreen = ({ route }: { route: any }) => {
|
|
|
? {
|
|
|
...msg,
|
|
|
_id: res.message_id,
|
|
|
- attachment: res.attachment,
|
|
|
- isSending: false,
|
|
|
- image:
|
|
|
- res.attachment?.attachment_small_url && file.type === 'image'
|
|
|
- ? API_HOST + res.attachment.attachment_small_url
|
|
|
- : undefined,
|
|
|
- video: res.attachment?.attachment_link
|
|
|
- ? API_HOST + res.attachment.attachment_link
|
|
|
- : undefined
|
|
|
+ isSending: false
|
|
|
}
|
|
|
: msg
|
|
|
)
|
|
@@ -1527,7 +1520,13 @@ const GroupChatScreen = ({ route }: { route: any }) => {
|
|
|
|
|
|
return (
|
|
|
<TouchableOpacity
|
|
|
- onPress={() => setSelectedMedia(API_HOST + currentMessage.attachment.attachment_full_url)}
|
|
|
+ onPress={() =>
|
|
|
+ setSelectedMedia(
|
|
|
+ currentMessage.attachment.attachment_full_url?.startsWith('/')
|
|
|
+ ? API_HOST + currentMessage.attachment.attachment_full_url
|
|
|
+ : currentMessage.attachment.attachment_full_url
|
|
|
+ )
|
|
|
+ }
|
|
|
onLongPress={() => handleLongPress(currentMessage, props)}
|
|
|
style={styles.imageContainer}
|
|
|
disabled={currentMessage.isSending}
|