From 68114429c0da7223f824e0df75ca15f7b6af9974 Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Mon, 8 Jun 2015 19:26:12 +0000 Subject: [PATCH] Use inArray helper instead of the jQuery direct function. Coding style --- js/public/app.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/public/app.js b/js/public/app.js index 59acd7a..3ce3aca 100644 --- a/js/public/app.js +++ b/js/public/app.js @@ -133,7 +133,8 @@ var checkNewMessages = function() { if (typeof jsondata['photos'][peerLabel] != 'undefined') { peerListBuf += 'style="background-image: url(' + jsondata['photos'][peerLabel] + ');"'; } - peerListBuf += '>' + peerLabel + ' (' + val + ')'; + peerListBuf += '>' + peerLabel + ' (' + val + ')'; $('#app-mailbox-peers ul').prepend(peerListBuf); bufferedContacts.push(peerLabel); @@ -329,7 +330,7 @@ function fetchInitialPeerList(jsondata) { fn = jsondata['contacts'][id]; peerLabel = fn; } - if ($.inArray(peerLabel, bufferedContacts) == -1) { + if (inArray(peerLabel, bufferedContacts)) { aScope.addContact({'label': peerLabel, 'nav': idxVal2, 'avatar': jsondata['photos'][peerLabel]}); bufferedContacts.push(peerLabel); }