Commit 9191737f authored by Benoit Lavenier's avatar Benoit Lavenier

[fix] Transfer modal: use the selected wallet as default wallet

parent a2c2db7d
......@@ -536,11 +536,11 @@ function WalletController($scope, $rootScope, $q, $ionicPopup, $timeout, $state,
// Transfer
$scope.showTransferModal = function() {
var hasCredit = (!!$scope.formData.balance && $scope.formData.balance > 0);
if (!hasCredit && !wallet.children.count()) {
if (!hasCredit && !csWallet.children.count()) {
UIUtils.alert.info('INFO.NOT_ENOUGH_CREDIT');
return;
}
Modals.showTransfer()
return Modals.showTransfer({wallet: wallet.id})
.then(function(done){
if (done) {
UIUtils.toast.show('INFO.TRANSFER_SENT');
......@@ -826,7 +826,14 @@ function WalletTxController($scope, $ionicPopover, $state, $timeout, $location,
UIUtils.alert.info('INFO.NOT_ENOUGH_CREDIT');
return;
}
return Modals.showTransfer();
return Modals.showTransfer({wallet: wallet.id})
.then(function(done){
if (done) {
UIUtils.toast.show('INFO.TRANSFER_SENT');
$scope.$broadcast('$$rebind::' + 'balance'); // force rebind balance
$scope.motion.show({selector: '.item-pending'});
}
});
};
$scope.showHelpTip = function(index, isTour) {
......@@ -866,7 +873,7 @@ function WalletTxController($scope, $ionicPopover, $state, $timeout, $location,
};
$scope.showSelectWalletModal = function() {
if (!$scope.enableSelectWallet) return;
if (!csWallet.children.count()) return;
return Modals.showSelectWallet({
showDefault: true,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment