From 69c303552bf05b5001237c5b0b2bf11b4656292c Mon Sep 17 00:00:00 2001 From: brantje Date: Fri, 7 Oct 2016 15:50:08 +0200 Subject: [PATCH] Small fix adding users to shared list --- js/app/controllers/share.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/js/app/controllers/share.js b/js/app/controllers/share.js index 4a589f12..af9b28b4 100644 --- a/js/app/controllers/share.js +++ b/js/app/controllers/share.js @@ -170,7 +170,13 @@ angular.module('passmanApp') pending: true, credential_guid: $scope.storedCredential.guid }; - if ($scope.share_settings.credentialSharedWithUserAndGroup.indexOf(obj) === -1) { + var found = false; + for(var z = 0; z < $scope.share_settings.credentialSharedWithUserAndGroup.length; z++){ + if($scope.share_settings.credentialSharedWithUserAndGroup[z].userId == shareWith[z].uid){ + found = true; + } + } + if (found === false) { $scope.share_settings.credentialSharedWithUserAndGroup.push(obj) } }