[FIX] Make attachment validation compatible with web client

This commit is contained in:
Anant Bhasin 2021-02-20 16:09:50 +05:30
parent 9a8047e64d
commit f62dbca1f1
1 changed files with 3 additions and 3 deletions

View File

@ -15,13 +15,13 @@ const Attachments = React.memo(({
}
return attachments.map((file, index) => {
if (file.image_url) {
if (file.type === 'file' && file.image_url) {
return <Image key={file.image_url} file={file} showAttachment={showAttachment} getCustomEmoji={getCustomEmoji} theme={theme} />;
}
if (file.audio_url) {
if (file.type === 'file' && file.audio_url) {
return <Audio key={file.audio_url} file={file} getCustomEmoji={getCustomEmoji} theme={theme} />;
}
if (file.video_url) {
if (file.type === 'file' && file.video_url) {
return <Video key={file.video_url} file={file} showAttachment={showAttachment} getCustomEmoji={getCustomEmoji} theme={theme} />;
}