var response = <%= raw @response.to_json %>;
<% if session[:mobile_view] %>
  window.location.href = "<%= conversations_path(conversation_id: @conversation.id) %>";
<% else %>
  app.flashMessages._flash(response.message, response.success);
  if(response.success){
    $("#new_conversation").removeClass('form_do_not_clear').clearForm();
    window.location.href = "<%= conversations_path(conversation_id: @conversation.id) %>";
  }
<% end %>

var response = <%= raw @response.to_json %>;
<% if session[:mobile_view] %>
  window.location.href = "<%= conversations_path(conversation_id: @conversation.id) %>";
<% else %>
  if(response.success){
    app.flashMessages.success(response.message);
    $("#new_conversation").removeClass('form_do_not_clear').clearForm();
    window.location.href = "<%= conversations_path(conversation_id: @conversation.id) %>";
  } else {
    app.flashMessages.error(response.message);
  }
<% end %>

Use the correct flash message for new conversations
Use the correct flash message for new conversations
