From 7c65b9907fec706d7c75b8582389e03bf7184290 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Wed, 12 Aug 2015 11:16:34 -0300 Subject: [PATCH] better find code --- src/js/services/profileService.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/js/services/profileService.js b/src/js/services/profileService.js index 3d9c03373..d3bb65c1f 100644 --- a/src/js/services/profileService.js +++ b/src/js/services/profileService.js @@ -224,9 +224,13 @@ angular.module('copayApp.services') try { var walletData = this.getUtils().fromSecret(opts.secret); - if (root.walletClients[walletData.walletId]) - return cb(gettext('Cannot join the same wallet more that once')); + // check if exist + if (lodash.find(root.profile.credentials, { + 'walletId': walletData.walletId + })) { + return cb(gettext('Cannot join the same wallet more that once')); + } } catch (ex) { return cb(gettext('Bad wallet invitation')); }