diff --git a/js/notifications.js b/js/notifications.js index e85e2483e..74a91067d 100644 --- a/js/notifications.js +++ b/js/notifications.js @@ -93,20 +93,22 @@ function getPush(refresh) // Add messages notifications to the list html = ""; nb_notifs = 0; - $.each(json.message, function(property, value) { - html += "
  • " + new_msg + "
    " + from_msg + "" + value.customer_name + "
    " + excerpt_msg + "" + value.message_customer + "
    " + see_msg + "
  • "; + $.each(json.customer_message, function(property, value) { + html += "
  • " + new_msg + "
    " + from_msg + "" + value.customer_name + "
    " + see_msg + "
  • "; }); + if (html != "") { - $("#list_messages_notif").prev("p").hide(); - $("#list_messages_notif").empty().append(html); - nb_notifs = $("#list_messages_notif li").length; - $("#messages_notif_value").text(nb_notifs); - $("#messages_notif_number_wrapper").show(); + + $("#list_customer_messages_notif").prev("p").hide(); + $("#list_customer_messages_notif").empty().append(html); + nb_notifs = $("#list_customer_messages_notif li").length; + $("#customer_messages_notif_value").text(nb_notifs); + $("#customer_messages_notif_number_wrapper").show(); } else { - $("#messages_notif_number_wrapper").hide(); + $("#customer_messages_notif_number_wrapper").hide(); } } if(refresh)