diff --git a/js/public/app.js b/js/public/app.js index 5813c8b..36c8a54 100644 --- a/js/public/app.js +++ b/js/public/app.js @@ -200,14 +200,21 @@ function fetchConversation(phoneNumber) { var len = jsondata["phoneNumbers"].length; var ctLen = 0; phoneNumberLabel = ''; + // This array permit to remove double entries + phoneNumberShown = []; $.each(jsondata["phoneNumbers"], function(id, val) { + // Don't add phone numbers is they are already shown + if ($.inArray(val, phoneNumberShown)) { + continue; + } phoneNumberLabel += val; ctLen++; if (ctLen != len) { phoneNumberLabel += ","; } phoneNumberLabel += " "; + phoneNumberShown.push(val); }); }