Update balance of wallets
This commit is contained in:
parent
212656130f
commit
0c9b36032b
3 changed files with 12 additions and 14 deletions
|
|
@ -2,13 +2,9 @@
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('HomeWalletController',
|
angular.module('copayApp.controllers').controller('HomeWalletController',
|
||||||
function($scope, $rootScope, $timeout, $modal, controllerUtils) {
|
function($scope, $rootScope, $timeout, $modal, controllerUtils) {
|
||||||
|
|
||||||
controllerUtils.redirIfNotComplete();
|
controllerUtils.redirIfNotComplete();
|
||||||
|
|
||||||
$rootScope.title = 'Home';
|
$rootScope.title = 'Home';
|
||||||
|
|
||||||
if ($rootScope.addrInfos) {
|
|
||||||
$scope.address = $rootScope.addrInfos[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,11 @@ angular.module('copayApp.controllers').controller('PaymentIntentController', fun
|
||||||
var w = $rootScope.iden.getWalletById(wid);
|
var w = $rootScope.iden.getWalletById(wid);
|
||||||
if (w && w.isReady()) {
|
if (w && w.isReady()) {
|
||||||
$scope.wallets.push(w);
|
$scope.wallets.push(w);
|
||||||
|
controllerUtils.clearBalanceCache(w);
|
||||||
controllerUtils.updateBalance(w, function() {
|
controllerUtils.updateBalance(w, function() {
|
||||||
$rootScope.$digest();
|
$rootScope.$digest();
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -28,9 +30,9 @@ angular.module('copayApp.controllers').controller('PaymentIntentController', fun
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
modalInstance.result.then(function(selectedItem) {}, function() {
|
// modalInstance.result.then(function(selectedItem) {}, function() {
|
||||||
$rootScope.pendingPayment = null;
|
// $rootScope.pendingPayment = null;
|
||||||
});
|
// });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -38,16 +40,16 @@ angular.module('copayApp.controllers').controller('PaymentIntentController', fun
|
||||||
// It is not the same as the $modal service used above.
|
// It is not the same as the $modal service used above.
|
||||||
|
|
||||||
var ModalInstanceCtrl = function($scope, $modalInstance, items, controllerUtils) {
|
var ModalInstanceCtrl = function($scope, $modalInstance, items, controllerUtils) {
|
||||||
|
|
||||||
$scope.wallets = items;
|
$scope.wallets = items;
|
||||||
|
|
||||||
$scope.ok = function(selectedItem) {
|
$scope.ok = function(selectedItem) {
|
||||||
controllerUtils.setPaymentWallet(selectedItem);
|
controllerUtils.setPaymentWallet(selectedItem);
|
||||||
$modalInstance.close();
|
$modalInstance.close();
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.cancel = function() {
|
$scope.cancel = function() {
|
||||||
$modalInstance.dismiss('cancel');
|
$rootScope.pendingPayment = null;
|
||||||
|
controllerUtils.setFocusedWallet($scope.wallets[0]);
|
||||||
|
$modalInstance.close();
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,15 +37,15 @@
|
||||||
<div class="panel oh">
|
<div class="panel oh">
|
||||||
<h2 class="line-b" translate>Quick receive</h2>
|
<h2 class="line-b" translate>Quick receive</h2>
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<qrcode size="220" data="bitcoin:{{address.addressStr}}"></qrcode>
|
<qrcode size="220" data="bitcoin:{{$root.addrInfos[0].addressStr}}"></qrcode>
|
||||||
|
|
||||||
<div class="m10t">
|
<div class="m10t">
|
||||||
<h4 class="size-12">{{address.addressStr}} <span class="btn-copy" clip-copy="address.addressStr"></span></h4>
|
<h4 class="size-12">{{$root.addrInfos[0].addressStr}} <span class="btn-copy" clip-copy="$root.addrInfos[0].addressStr"></span></h4>
|
||||||
<span ng-if="$root.updatingBalance">
|
<span ng-if="$root.updatingBalance">
|
||||||
<i class="fi-bitcoin-circle icon-rotate spinner"></i>
|
<i class="fi-bitcoin-circle icon-rotate spinner"></i>
|
||||||
</span>
|
</span>
|
||||||
<div class="small-10 columns small-centered">
|
<div class="small-10 columns small-centered">
|
||||||
<button class="m15t button secondary hide-for-large-up" ng-show="isMobile" ng-click="mobileCopy(address.addressStr)">
|
<button class="m15t button secondary hide-for-large-up" ng-show="isMobile" ng-click="mobileCopy($root.addrInfos[0].addressStr)">
|
||||||
<i class="fi-link"> </i> <span translate>Copy to clipboard</span>
|
<i class="fi-link"> </i> <span translate>Copy to clipboard</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue