Merge branch 'ref/design' of https://github.com/bitpay/bitpay-wallet into feature/onboarding_backup_phrase
This commit is contained in:
commit
a20802b3c5
29 changed files with 150 additions and 59 deletions
|
|
@ -50,6 +50,7 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
|||
|
||||
$scope.toAddress = $stateParams.toAddress;
|
||||
$scope.toName = $stateParams.toName;
|
||||
$scope.toEmail = $stateParams.toEmail;
|
||||
|
||||
var config = configService.getSync().wallet.settings;
|
||||
$scope.unitName = config.unitName;
|
||||
|
|
@ -191,6 +192,7 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
|||
toAmount: amount * unitToSatoshi,
|
||||
toAddress: $scope.toAddress,
|
||||
toName: $scope.toName,
|
||||
toEmail: $scope.toEmail
|
||||
});
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -102,6 +102,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
|||
|
||||
$scope.toAddress = $stateParams.toAddress;
|
||||
$scope.toName = $stateParams.toName;
|
||||
$scope.toEmail = $stateParams.toEmail;
|
||||
$scope.description = $stateParams.description;
|
||||
$scope.paypro = $stateParams.paypro;
|
||||
|
||||
|
|
@ -119,12 +120,14 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
|||
|
||||
lodash.each(wallets, function(w) {
|
||||
walletService.getStatus(w, {}, function(err, status) {
|
||||
if (err) $log.error(err);
|
||||
if (!status.availableBalanceSat) $log.debug('No balance available in: ' + w.name);
|
||||
if (status.availableBalanceSat > amount) filteredWallets.push(w);
|
||||
if (err || !status) {
|
||||
$log.error(err);
|
||||
} else {
|
||||
if (!status.availableBalanceSat) $log.debug('No balance available in: ' + w.name);
|
||||
if (status.availableBalanceSat > amount) filteredWallets.push(w);
|
||||
}
|
||||
|
||||
if (++index == wallets.length) {
|
||||
|
||||
if (!lodash.isEmpty(filteredWallets)) {
|
||||
$scope.wallets = lodash.clone(filteredWallets);
|
||||
$scope.notAvailable = false;
|
||||
|
|
@ -135,7 +138,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
|||
|
||||
$timeout(function() {
|
||||
$scope.$apply();
|
||||
}, 10);
|
||||
});
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('backupWarningController', function($scope, $state, $stateParams, $ionicPopup, profileService) {
|
||||
angular.module('copayApp.controllers').controller('backupWarningController', function($scope, $state, $timeout, $stateParams, $ionicPopup, profileService) {
|
||||
|
||||
$scope.walletId = $stateParams.walletId;
|
||||
$scope.openPopup = function() {
|
||||
|
|
@ -11,7 +11,10 @@ angular.module('copayApp.controllers').controller('backupWarningController', fun
|
|||
|
||||
$scope.close = function() {
|
||||
backupWarningPopup.close();
|
||||
$state.go('onboarding.backup', {walletId: $stateParams.walletId, fromOnboarding: true});
|
||||
$state.go('onboarding.backup', {
|
||||
walletId: $stateParams.walletId,
|
||||
fromOnboarding: true
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ angular.module('copayApp.controllers').controller('collectEmailController', func
|
|||
var isCordova = platformInfo.isCordova;
|
||||
var isWP = platformInfo.isWP;
|
||||
var usePushNotifications = isCordova && !isWP;
|
||||
var requiresOptIn = platformInfo.isIOS;
|
||||
|
||||
var wallet = profileService.getWallet($stateParams.walletId);
|
||||
var walletId = wallet.credentials.walletId;
|
||||
|
|
@ -21,16 +22,29 @@ angular.module('copayApp.controllers').controller('collectEmailController', func
|
|||
if (err) $log.warn(err);
|
||||
configService.set(opts, function(err) {
|
||||
if (err) $log.warn(err);
|
||||
if (!usePushNotifications) $state.go('onboarding.backupRequest', {
|
||||
walletId: walletId
|
||||
});
|
||||
else $state.go('onboarding.notifications', {
|
||||
walletId: walletId
|
||||
});
|
||||
$scope.goNextView();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
$scope.goNextView = function() {
|
||||
if (!usePushNotifications) {
|
||||
$state.go('onboarding.backupRequest', {
|
||||
walletId: walletId
|
||||
});
|
||||
}
|
||||
else if (requiresOptIn) {
|
||||
$state.go('onboarding.notifications', {
|
||||
walletId: walletId
|
||||
});
|
||||
} else {
|
||||
profileService.pushNotificationsInit();
|
||||
$state.go('onboarding.backupRequest', {
|
||||
walletId: walletId
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$scope.confirm = function(emailForm) {
|
||||
if (emailForm.$invalid) return;
|
||||
$scope.confirmation = true;
|
||||
|
|
@ -44,9 +58,4 @@ angular.module('copayApp.controllers').controller('collectEmailController', func
|
|||
}, 1);
|
||||
};
|
||||
|
||||
$scope.onboardingMailSkip = function() {
|
||||
$state.go('onboarding.backupRequest', {
|
||||
walletId: walletId
|
||||
});
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -5,7 +5,9 @@ angular.module('copayApp.controllers').controller('notificationsController', fun
|
|||
$scope.walletId = $stateParams.walletId;
|
||||
$scope.allowNotif = function() {
|
||||
profileService.pushNotificationsInit();
|
||||
$state.go('onboarding.backupRequest');
|
||||
$state.go('onboarding.backupRequest', {
|
||||
walletId: $scope.walletId
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('tabSendController', function($scope, $log, $timeout, addressbookService, profileService, lodash, $state, walletService, incomingData ) {
|
||||
angular.module('copayApp.controllers').controller('tabSendController', function($scope, $log, $timeout, addressbookService, profileService, lodash, $state, walletService, incomingData) {
|
||||
|
||||
var originalList;
|
||||
|
||||
|
|
@ -30,6 +30,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
|
|||
contacts.push({
|
||||
name: lodash.isObject(v) ? v.name : v,
|
||||
address: k,
|
||||
email: lodash.isObject(v) ? v.email : null,
|
||||
getAddress: function(cb) {
|
||||
return cb(null, k);
|
||||
},
|
||||
|
|
@ -76,7 +77,8 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
|
|||
$log.debug('Got toAddress:' + addr + ' | ' + item.name);
|
||||
return $state.transitionTo('send.amount', {
|
||||
toAddress: addr,
|
||||
toName: item.name
|
||||
toName: item.name,
|
||||
toEmail: item.email
|
||||
})
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue