Merge branch 'ref/design' of https://github.com/bitpay/bitpay-wallet into feature/address_book

This commit is contained in:
Jamal Jackson 2016-09-23 11:30:56 -04:00
commit 6e23e35171
10 changed files with 71 additions and 49 deletions

View file

@ -20,6 +20,9 @@ angular.module('copayApp.controllers').controller('addressbookListController', f
});
$scope.addressbook = lodash.clone(contacts);
$timeout(function() {
$scope.$apply();
}, 100);
});
};

View file

@ -89,13 +89,16 @@ angular.module('copayApp.controllers').controller('confirmController', function(
$scope.showDescriptionPopup = function() {
var title = gettextCatalog.getString('Add description');
var message = gettextCatalog.getString('Add description');
var opts = {
defaultText: $scope.description
};
popupService.showPrompt(title, null, opts, function(res) {
popupService.showPrompt(null, message, opts, function(res) {
if (res) $scope.description = res;
$timeout(function() {
$scope.$apply();
}, 100);
});
};
@ -272,8 +275,8 @@ angular.module('copayApp.controllers').controller('confirmController', function(
var touchIdEnabled = config.touchIdFor && !config.touchIdFor[wallet.id];
var isCordova = $scope.isCordova;
var bigAmount = parseFloat(txFormatService.formatToUSD(txp.amount)) > 20;
var message = gettextCatalog.getString('Sending {{fee}} from your {{name}} wallet', {
fee: $scope.fee,
var message = gettextCatalog.getString('Sending {{amountStr}} from your {{name}} wallet', {
amountStr: $scope.amountStr,
name: wallet.name
});
var okText = gettextCatalog.getString('Confirm');
@ -307,7 +310,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
$state.go('tabs.send');
};
$scope.$on("$ionicView.enter", function(event, data){
$scope.$on("$ionicView.enter", function(event, data) {
initConfirm();
});
});

View file

@ -16,6 +16,7 @@ angular.module('copayApp.controllers').controller('txStatusController', function
disableAnimate: true,
disableBack: true
});
$ionicHistory.removeBackView();
$state.go('tabs.send.addressbook', {
fromSendTab: true,
addressbookEntry: addressbookEntry

View file

@ -5,10 +5,6 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
$scope.isCordova = platformInfo.isCordova;
$scope.isNW = platformInfo.isNW;
$scope.wallets = profileService.getWallets({
onlyComplete: true
});
$scope.checkTips = function(force) {
storageService.getReceiveTipsAccepted(function(err, accepted) {
if (err) $log.warn(err);
@ -25,16 +21,6 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
});
};
$scope.$on('Wallet/Changed', function(event, wallet) {
if (!wallet) {
$log.debug('No wallet provided');
return;
}
$scope.wallet = wallet;
$log.debug('Wallet changed: ' + wallet.name);
$scope.setAddress();
});
$scope.shareAddress = function(addr) {
if ($scope.generatingAddress) return;
if ($scope.isCordova) {
@ -61,5 +47,19 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi
}, 1);
};
if (!$scope.isCordova) $scope.checkTips();
$scope.$on("$ionicView.enter", function(event, data) {
if (!$scope.isCordova) $scope.checkTips();
$scope.wallets = profileService.getWallets({
onlyComplete: true
});
$scope.$on('Wallet/Changed', function(event, wallet) {
if (!wallet) {
$log.debug('No wallet provided');
return;
}
$scope.wallet = wallet;
$log.debug('Wallet changed: ' + wallet.name);
$scope.setAddress();
});
});
});

View file

@ -189,7 +189,7 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
function cacheBalance(wallet, balance) {
if (!balance) return;
var config = configService.getSync().wallet.settings;
var config = configService.getSync().wallet;
var cache = wallet.cachedStatus;
@ -197,7 +197,7 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
cache.balanceByAddress = balance.byAddress;
// Spend unconfirmed funds
if (cache.spendUnconfirmed) {
if (config.spendUnconfirmed) {
cache.totalBalanceSat = balance.totalAmount;
cache.lockedBalanceSat = balance.lockedAmount;
cache.availableBalanceSat = balance.availableAmount;
@ -212,9 +212,9 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
}
// Selected unit
cache.unitToSatoshi = config.unitToSatoshi;
cache.unitToSatoshi = config.settings.unitToSatoshi;
cache.satToUnit = 1 / cache.unitToSatoshi;
cache.unitName = config.unitName;
cache.unitName = config.settings.unitName;
//STR
cache.totalBalanceStr = txFormatService.formatAmount(cache.totalBalanceSat) + ' ' + cache.unitName;
@ -227,8 +227,8 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
cache.pendingAmountStr = null;
}
cache.alternativeName = config.alternativeName;
cache.alternativeIsoCode = config.alternativeIsoCode;
cache.alternativeName = config.settings.alternativeName;
cache.alternativeIsoCode = config.settings.alternativeIsoCode;
rateService.whenAvailable(function() {

View file

@ -12,6 +12,16 @@
bottom: 49px;
width: 100%;
height: 100px;
background-color: #f5f5f5;
}
background-color: #647CE8;
color: #ffffff;
font-size: 25px;
text-align: center;
padding-top: 34px;
line-height: 32px;
}
.accept-slide i {
float: right;
font-size: 32px;
margin-right: 20px;
}
}