[FIX] Only single attachment rendered (#417)
This commit is contained in:
parent
8a71b04b65
commit
9f9a9b71a4
|
@ -241,19 +241,20 @@ export default class Message extends React.Component {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const file = this.props.item.attachments[0];
|
return this.props.item.attachments.map((file) => {
|
||||||
const { user } = this.props;
|
const { user } = this.props;
|
||||||
if (file.image_url) {
|
if (file.image_url) {
|
||||||
return <Image file={file} user={user} />;
|
return <Image file={file} user={user} />;
|
||||||
}
|
}
|
||||||
if (file.audio_url) {
|
if (file.audio_url) {
|
||||||
return <Audio file={file} user={user} />;
|
return <Audio file={file} user={user} />;
|
||||||
}
|
}
|
||||||
if (file.video_url) {
|
if (file.video_url) {
|
||||||
return <Video file={file} user={user} />;
|
return <Video file={file} user={user} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
return <Reply attachment={file} timeFormat={this.timeFormat} />;
|
return <Reply attachment={file} timeFormat={this.timeFormat} />;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
renderUrl = () => {
|
renderUrl = () => {
|
||||||
|
|
Loading…
Reference in New Issue