From a620277d867f14652dc21f3d1e0454a8a7522f66 Mon Sep 17 00:00:00 2001 From: Ner'zhul Date: Mon, 8 Jun 2015 16:23:54 +0200 Subject: [PATCH] Remove duplicate phonenumbers in conversation list --- js/public/app.js | 7 +++++++ 1 file changed, 7 insertions(+) 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); }); }