conversations_helper.rb 328 Bytes
Newer Older
1 2
# frozen_string_literal: true

3 4
module ConversationsHelper
  def conversation_class(conversation, unread_count, selected_conversation_id)
5 6 7 8
    conv_class = unread_count > 0 ? "unread" : ""
    return conv_class unless selected_conversation_id && conversation.id == selected_conversation_id

    "#{conv_class} selected"
9 10
  end
end