Merge branch 'ref/design' of https://github.com/bitpay/bitpay-wallet into feature/external_link_open_system_browser
# Conflicts: # src/js/services/externalLinkService.js
This commit is contained in:
commit
3d9e40b4c5
10 changed files with 73 additions and 40 deletions
|
|
@ -297,7 +297,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
|||
|
||||
var config = configService.getSync();
|
||||
var spendingPassEnabled = walletService.isEncrypted(wallet);
|
||||
var touchIdEnabled = config.touchIdFor && !config.touchIdFor[wallet.id];
|
||||
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 {{amountStr}} from your {{name}} wallet', {
|
||||
|
|
@ -308,17 +308,20 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
|||
var cancelText = gettextCatalog.getString('Cancel');
|
||||
|
||||
if (!spendingPassEnabled && !touchIdEnabled) {
|
||||
if (isCordova && bigAmount) {
|
||||
popupService.showConfirm(null, message, okText, cancelText, function(ok) {
|
||||
if (!ok) {
|
||||
$scope.sendStatus = '';
|
||||
$timeout(function() {
|
||||
$scope.$apply();
|
||||
});
|
||||
return;
|
||||
}
|
||||
publishAndSign(wallet, txp, onSendStatusChange);
|
||||
});
|
||||
if (isCordova) {
|
||||
if (bigAmount) {
|
||||
popupService.showConfirm(null, message, okText, cancelText, function(ok) {
|
||||
if (!ok) {
|
||||
$scope.sendStatus = '';
|
||||
$timeout(function() {
|
||||
$scope.$apply();
|
||||
});
|
||||
return;
|
||||
}
|
||||
publishAndSign(wallet, txp, onSendStatusChange);
|
||||
});
|
||||
}
|
||||
else publishAndSign(wallet, txp, onSendStatusChange);
|
||||
}
|
||||
else {
|
||||
popupService.showConfirm(null, message, okText, cancelText, function(ok) {
|
||||
|
|
|
|||
|
|
@ -27,16 +27,26 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio
|
|||
};
|
||||
|
||||
function updateMemo() {
|
||||
wallet.getTxNote({
|
||||
txid: $scope.btx.txid
|
||||
}, function(err, note) {
|
||||
if (err || !note) {
|
||||
$log.debug(gettextCatalog.getString('Could not fetch transaction note'));
|
||||
walletService.getTxNote(wallet, $scope.btx.txid, function(err, note) {
|
||||
if (err) {
|
||||
$log.warn('Could not fetch transaction note ' + err);
|
||||
return;
|
||||
}
|
||||
$scope.note = note;
|
||||
$timeout(function() {
|
||||
$scope.$apply();
|
||||
|
||||
if (!note) return;
|
||||
|
||||
$scope.btx.note = note;
|
||||
|
||||
walletService.getTx(wallet, $scope.btx.txid, function(err, tx) {
|
||||
if (err) {
|
||||
$log.error(err);
|
||||
return;
|
||||
}
|
||||
|
||||
tx.note = note;
|
||||
$timeout(function() {
|
||||
$scope.$apply();
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
@ -91,19 +101,13 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio
|
|||
body: text
|
||||
};
|
||||
|
||||
wallet.editTxNote(args, function(err) {
|
||||
walletService.editTxNote(wallet, args, function(err, res) {
|
||||
if (err) {
|
||||
$log.debug('Could not save tx comment');
|
||||
$log.debug('Could not save tx comment ' + err);
|
||||
return;
|
||||
}
|
||||
// This is only to refresh the current screen data
|
||||
$scope.btx.note = null;
|
||||
if (args.body) {
|
||||
$scope.btx.note = {};
|
||||
$scope.btx.note.body = text;
|
||||
$scope.btx.note.editedByName = wallet.credentials.copayerName;
|
||||
$scope.btx.note.editedOn = Math.floor(Date.now() / 1000);
|
||||
}
|
||||
updateMemo();
|
||||
$scope.btx.searcheableString = null;
|
||||
$timeout(function() {
|
||||
$scope.$apply();
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
|
|||
|
||||
|
||||
var updateHasFunds = function() {
|
||||
$scope.hasFunds = null;
|
||||
$scope.hasFunds = true;
|
||||
|
||||
var wallets = profileService.getWallets({
|
||||
onlyComplete: true,
|
||||
|
|
@ -114,6 +114,9 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
|
|||
|
||||
if (!wallets || !wallets.length) {
|
||||
$scope.hasFunds = false;
|
||||
$timeout(function() {
|
||||
$scope.$apply();
|
||||
});
|
||||
}
|
||||
|
||||
var index = 0;
|
||||
|
|
@ -124,13 +127,16 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
|
|||
$log.error(err);
|
||||
return;
|
||||
}
|
||||
|
||||
if (status.availableBalanceSat) {
|
||||
if (status.availableBalanceSat && status.availableBalanceSat > 0) {
|
||||
$scope.hasFunds = true;
|
||||
}
|
||||
else $scope.hasFunds = false;
|
||||
if (index == wallets.length) {
|
||||
$scope.hasFunds = $scope.hasFunds || false;
|
||||
}
|
||||
$timeout(function() {
|
||||
$scope.$apply();
|
||||
})
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue