From f3d608256c8abe356bd423a4dca76832e5236ce0 Mon Sep 17 00:00:00 2001 From: eileen Date: Fri, 26 Feb 2021 16:08:27 +1300 Subject: [PATCH] Change array filtering method This addresses #10 - which is a tricky issue to replicate although I was managing semi-reliably with the contact creates in that issue. --- ang/deduper/dupefindCntrl.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ang/deduper/dupefindCntrl.js b/ang/deduper/dupefindCntrl.js index 2679f6c..6c95ca6 100644 --- a/ang/deduper/dupefindCntrl.js +++ b/ang/deduper/dupefindCntrl.js @@ -358,10 +358,8 @@ } function removeMergedContact(id) { - _.each($scope.duplicatePairs, function(pair, index) { - if (typeof(pair) !== 'undefined' && (pair['dstID'] === id || pair['srcID'] === id)) { - $scope.duplicatePairs.splice(index, 1); - } + $scope.duplicatePairs = $.grep($scope.duplicatePairs, function (pair) { + return typeof(pair) !== 'undefined' && pair.dstID !== id && pair.srcID !== id; }); updateFoundCount(); }