Merge pull request #153 from gabrielbazan7/feat/addEntrySend
add addressbook entry when send success
This commit is contained in:
commit
912789ccb6
8 changed files with 123 additions and 35 deletions
|
|
@ -1,9 +1,11 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('addressbookAddController', function($scope, $state, $timeout, addressbookService, popupService) {
|
||||
angular.module('copayApp.controllers').controller('addressbookAddController', function($scope, $state, $stateParams, $timeout, $ionicHistory, addressbookService, popupService) {
|
||||
|
||||
$scope.fromSendTab = $stateParams.fromSendTab;
|
||||
|
||||
$scope.addressbookEntry = {
|
||||
'address': '',
|
||||
'address': $stateParams.addressbookEntry || '',
|
||||
'name': '',
|
||||
'email': ''
|
||||
};
|
||||
|
|
@ -28,9 +30,15 @@ angular.module('copayApp.controllers').controller('addressbookAddController', fu
|
|||
popupService.showAlert(err);
|
||||
return;
|
||||
}
|
||||
$state.go('tabs.addressbook');
|
||||
if ($scope.fromSendTab) $scope.goHome();
|
||||
else $state.go('tabs.addressbook');
|
||||
});
|
||||
}, 100);
|
||||
};
|
||||
|
||||
$scope.goHome = function() {
|
||||
$ionicHistory.clearHistory();
|
||||
$state.go('tabs.home');
|
||||
};
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -261,8 +261,6 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
|||
|
||||
return walletService.onlyPublish(wallet, txp, function(err, txp) {
|
||||
if (err) return setSendError(err);
|
||||
$ionicHistory.clearHistory();
|
||||
$state.go('tabs.home');
|
||||
});
|
||||
}
|
||||
ongoingProcess.set('creatingTx', true);
|
||||
|
|
@ -303,8 +301,6 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
|||
function publishAndSign(wallet, txp) {
|
||||
walletService.publishAndSign(wallet, txp, function(err, txp) {
|
||||
if (err) return setSendError(err);
|
||||
$ionicHistory.clearHistory();
|
||||
$state.go('tabs.home');
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,27 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('txStatusController', function($scope, $timeout) {
|
||||
angular.module('copayApp.controllers').controller('txStatusController', function($scope, $timeout, $state, $log, addressbookService) {
|
||||
|
||||
if ($scope.cb) $timeout($scope.cb, 100);
|
||||
|
||||
$scope.cancel = function() {
|
||||
$scope.txStatusModal.hide();
|
||||
};
|
||||
|
||||
$scope.save = function(addressbookEntry) {
|
||||
$scope.txStatusModal.hide();
|
||||
$state.go('tabs.send.addressbook', {
|
||||
fromSendTab: true,
|
||||
addressbookEntry: addressbookEntry
|
||||
})
|
||||
}
|
||||
|
||||
addressbookService.list(function(err, ab) {
|
||||
if (err) $log.error(err);
|
||||
if (ab[$scope.tx.toAddress]) {
|
||||
$scope.entryExist = true;
|
||||
$log.debug('Entry already exist');
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -222,13 +222,13 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
}
|
||||
})
|
||||
|
||||
/*
|
||||
*
|
||||
* Send
|
||||
*
|
||||
*/
|
||||
/*
|
||||
*
|
||||
* Send
|
||||
*
|
||||
*/
|
||||
|
||||
.state('tabs.send.amount', {
|
||||
.state('tabs.send.amount', {
|
||||
url: '/amount/:toAddress/:toName/:toEmail',
|
||||
views: {
|
||||
'tab-send@tabs': {
|
||||
|
|
@ -244,7 +244,15 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
}
|
||||
}
|
||||
})
|
||||
|
||||
.state('tabs.send.addressbook', {
|
||||
url: '/addressbook/add/:fromSendTab/:addressbookEntry',
|
||||
views: {
|
||||
'tab-send@tabs': {
|
||||
templateUrl: 'views/addressbook.add.html',
|
||||
controller: 'addressbookAddController'
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
/*
|
||||
*
|
||||
|
|
@ -709,24 +717,24 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
templateUrl: 'views/sellCoinbase.html'
|
||||
})
|
||||
|
||||
/*
|
||||
*
|
||||
* Gift Cards
|
||||
*
|
||||
*/
|
||||
/*
|
||||
*
|
||||
* Gift Cards
|
||||
*
|
||||
*/
|
||||
|
||||
.state('tabs.giftcards', {
|
||||
url: '/giftcards',
|
||||
abstract: true
|
||||
})
|
||||
.state('tabs.giftcards', {
|
||||
url: '/giftcards',
|
||||
abstract: true
|
||||
})
|
||||
|
||||
/*
|
||||
*
|
||||
* Amazon.com Gift Card
|
||||
*
|
||||
*/
|
||||
/*
|
||||
*
|
||||
* Amazon.com Gift Card
|
||||
*
|
||||
*/
|
||||
|
||||
.state('tabs.giftcards.amazon', {
|
||||
.state('tabs.giftcards.amazon', {
|
||||
url: '/amazon',
|
||||
views: {
|
||||
'tab-home@tabs': {
|
||||
|
|
|
|||
|
|
@ -1000,3 +1000,4 @@ input[type=number] {
|
|||
@import "views/includes/modals/modals";
|
||||
@import "views/includes/tx-details";
|
||||
@import "views/includes/txp-details";
|
||||
@import "views/includes/tx-status";
|
||||
|
|
|
|||
27
src/sass/views/includes/tx-status.scss
Normal file
27
src/sass/views/includes/tx-status.scss
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#tx-status {
|
||||
.address {
|
||||
display: flex;
|
||||
padding: 5px 15px;
|
||||
background-color: #f5f5f5;
|
||||
margin-top: 10px;
|
||||
i {
|
||||
color: grey;
|
||||
padding-right: 10px;
|
||||
border-right: 1px solid;
|
||||
border-color: grey;
|
||||
font-size: 20px;
|
||||
}
|
||||
contact {
|
||||
margin-left: 15px;
|
||||
margin-bottom: 3px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
}
|
||||
.collect-address{
|
||||
bottom: 0;
|
||||
background: #fff;
|
||||
color: #6c6c6c;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue