Refactor network environment
This commit is contained in:
parent
03965b6e3a
commit
e466405769
4 changed files with 20 additions and 22 deletions
|
|
@ -1,13 +1,11 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('amazonController',
|
||||
function($scope, $timeout, $ionicModal, $log, lodash, bwcError, configService, amazonService) {
|
||||
function($scope, $timeout, $ionicModal, $log, lodash, bwcError, amazonService) {
|
||||
|
||||
this.init = function() {
|
||||
var self = this;
|
||||
var network = configService.getSync().amazon.testnet ? 'testnet' : 'livenet';
|
||||
self.sandbox = network == 'testnet' ? true : false;
|
||||
amazonService.setCredentials(network);
|
||||
self.sandbox = amazonService.getEnvironment() == 'testnet' ? true : false;
|
||||
amazonService.getPendingGiftCards(function(err, gcds) {
|
||||
if (err) {
|
||||
self.error = err;
|
||||
|
|
|
|||
|
|
@ -15,8 +15,7 @@ angular.module('copayApp.controllers').controller('buyAmazonController',
|
|||
};
|
||||
|
||||
this.init = function() {
|
||||
var network = configService.getSync().amazon.testnet ? 'testnet' : 'livenet';
|
||||
amazonService.setCredentials(network);
|
||||
var network = amazonService.getEnvironment();
|
||||
self.allWallets = profileService.getWallets(network, 1);
|
||||
client = profileService.focusedClient;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue