Fix send, settings and addressbook views
This commit is contained in:
parent
18c0d829c7
commit
aac067e216
4 changed files with 42 additions and 37 deletions
|
|
@ -2,27 +2,32 @@
|
|||
|
||||
angular.module('copayApp.controllers').controller('addressbookViewController', function($scope, $state, $timeout, $stateParams, lodash, addressbookService, popupService, $ionicHistory) {
|
||||
|
||||
var address = $stateParams.address;
|
||||
$scope.$on("$ionicView.beforeEnter", function(event, data){
|
||||
var address = data.stateParams.address;
|
||||
|
||||
if (!address) {
|
||||
$state.go('tabs.addressbook');
|
||||
return;
|
||||
}
|
||||
|
||||
addressbookService.get(address, function(err, obj) {
|
||||
if (err) {
|
||||
popupService.showAlert(err);
|
||||
if (!address) {
|
||||
$ionicHistory.back();
|
||||
return;
|
||||
}
|
||||
if (!lodash.isObject(obj)) {
|
||||
var name = obj;
|
||||
obj = {
|
||||
'name': name,
|
||||
'address': address,
|
||||
'email': ''
|
||||
};
|
||||
}
|
||||
$scope.addressbookEntry = obj;
|
||||
|
||||
addressbookService.get(address, function(err, obj) {
|
||||
if (err) {
|
||||
popupService.showAlert(err);
|
||||
return;
|
||||
}
|
||||
if (!lodash.isObject(obj)) {
|
||||
var name = obj;
|
||||
obj = {
|
||||
'name': name,
|
||||
'address': address,
|
||||
'email': ''
|
||||
};
|
||||
}
|
||||
$scope.addressbookEntry = obj;
|
||||
$timeout(function() {
|
||||
$scope.$apply();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$scope.sendTo = function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue