diff --git a/app/components/chat_message/chat_message.html.erb b/app/components/chat_message/chat_message.html.erb index d6771a947..e8e938daa 100644 --- a/app/components/chat_message/chat_message.html.erb +++ b/app/components/chat_message/chat_message.html.erb @@ -59,34 +59,36 @@ <% end %> <% end %> - <% if image? %> - <% if message.text.blank? %> + <% unless files.empty? %> + <% if image? %> + <% if message.text.blank? %> +
+ <% if message.sender %> + <%= c 'avatar', record: message.sender, style: :small, class: "ChatMessage-avatar" %> + <% else %> + <%= c 'avatar', style: :small, class: "ChatMessage-avatar" %> + <% end %> + <%= c 'chat_message_photos', photos: image_files %> +
+ <% else %> + <%= c 'chat_message_photos', photos: image_files %> + <% end %> + <% end %> + + <% if audio? %>
<% if message.sender %> <%= c 'avatar', record: message.sender, style: :small, class: "ChatMessage-avatar" %> <% else %> <%= c 'avatar', style: :small, class: "ChatMessage-avatar" %> <% end %> - <%= c 'chat_message_photos', photos: files %> + <%= c 'chat_message_audio', audios: audio_files %>
- <% else %> - <%= c 'chat_message_photos', photos: files %> <% end %> - <% end %> - - <% if audio? %> -
- <% if message.sender %> - <%= c 'avatar', record: message.sender, style: :small, class: "ChatMessage-avatar" %> - <% else %> - <%= c 'avatar', style: :small, class: "ChatMessage-avatar" %> - <% end %> - <%= c 'chat_message_audio', audio: audio %> -
- <% end %> - <% if video? %> - <%= c 'chat_message_video', videos: files %> + <% if video? %> + <%= c 'chat_message_video', videos: video_files %> + <% end %> <% end %>