Use the correct flash message for new conversations
This commit is contained in:
parent
7c6e7dbf0b
commit
b2d26257d4
1 changed files with 3 additions and 1 deletions
|
|
@ -2,9 +2,11 @@ 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){
|
||||
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 %>
|
||||
|
|
|
|||
Loading…
Reference in a new issue