diff --git a/public/views/paymentUri.html b/public/views/paymentUri.html index 0c5ece585..390a84d77 100644 --- a/public/views/paymentUri.html +++ b/public/views/paymentUri.html @@ -9,7 +9,7 @@

Bitcoin URI is NOT valid!

-
+

Make a payment to

Address: {{payment.uri.address.toString()}}
@@ -17,19 +17,30 @@
Message: {{payment.uri.message}}
Network: {{payment.uri.network}}
-

Select a wallet

- +
+
+ + There are not wallets to make this payment + [testnet] + +
+
+ +
+

Select a wallet

+ +
diff --git a/src/js/controllers/paymentUri.js b/src/js/controllers/paymentUri.js index 831c5c791..9d88f35eb 100644 --- a/src/js/controllers/paymentUri.js +++ b/src/js/controllers/paymentUri.js @@ -38,24 +38,7 @@ angular.module('copayApp.controllers').controller('paymentUriController', }; this.getWallets = function(network) { - if (!profileService.profile) return; - var config = configService.getSync(); - config.colorFor = config.colorFor || {}; - config.aliasFor = config.aliasFor || {}; - var ret = lodash.map(profileService.profile.credentials, function(c) { - return { - m: c.m, - n: c.n, - name: config.aliasFor[c.walletId] || c.walletName, - id: c.walletId, - network: c.network, - color: config.colorFor[c.walletId] || '#2C3E50' - }; - }); - ret = lodash.filter(ret, function(w) { - return (w.network == network); - }); - return lodash.sortBy(ret, 'name'); + return profileService.getWallets(network); }; this.selectWallet = function(wid) { diff --git a/src/js/services/profileService.js b/src/js/services/profileService.js index d237bf47a..28c5477e7 100644 --- a/src/js/services/profileService.js +++ b/src/js/services/profileService.js @@ -396,5 +396,29 @@ angular.module('copayApp.services') }); }; + root.getWallets = function(network) { + if (!root.profile) return []; + + var config = configService.getSync(); + config.colorFor = config.colorFor || {}; + config.aliasFor = config.aliasFor || {}; + var ret = lodash.map(root.profile.credentials, function(c) { + return { + m: c.m, + n: c.n, + name: config.aliasFor[c.walletId] || c.walletName, + id: c.walletId, + network: c.network, + color: config.colorFor[c.walletId] || '#2C3E50' + }; + }); + ret = lodash.filter(ret, function(w) { + return (w.network == network); + }); + return lodash.sortBy(ret, 'name'); + }; + + + return root; });