Use the correct flash message for new conversations

This commit is contained in:
Steffen van Bergerem 2016-06-29 21:37:00 +02:00
parent 7c6e7dbf0b
commit b2d26257d4
No known key found for this signature in database
GPG key ID: 2F08F75F9525C7E0

View file

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