diff --git a/js/public/app.js b/js/public/app.js index 36c8a54..59acd7a 100644 --- a/js/public/app.js +++ b/js/public/app.js @@ -22,6 +22,17 @@ var originalTitle = document.title; var app = angular.module('OcSms', []); +function inArray(val, arr) { + return ($.inArray(val, arr) != -1); +} + +function arrayUnique(arr) { + unq = arr.filter(function(item, i, arr) { + return i == arr.indexOf(item); + }) + return unq; +} + app.controller('OcSmsController', ['$scope', function ($scope) { $scope.buttons = [ @@ -116,7 +127,7 @@ var checkNewMessages = function() { peerLabel = fn; } - if ($.inArray(peerLabel, bufferedContacts) == -1) { + if (inArray(peerLabel, bufferedContacts)) { $("li[peer-label='" + peerLabel + "']").remove(); peerListBuf = '