Merge pull request #279 from Bitcoin-com/wallet/sprint/20

Wallet/sprint/20
This commit is contained in:
Jean-Baptiste Dominguez 2018-08-14 16:49:22 +09:00 committed by GitHub
commit a34520c2a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 25 additions and 8 deletions

View file

@ -2648,7 +2648,7 @@ msgid "Paste Address"
msgstr ""
#: www/views/tab-send.html:27
msgid "Wallet to Wallet Transfer"
msgid "Transfer between wallets"
msgstr ""
#: www/views/tab-send.html:35

View file

@ -4,7 +4,7 @@ angular
.module('copayApp.controllers')
.controller('reviewController', reviewController);
function reviewController(addressbookService, bitcoinCashJsService, bitcore, bitcoreCash, bwcError, configService, feeService, gettextCatalog, $interval, $ionicHistory, $ionicModal, lodash, $log, ongoingProcess, platformInfo, popupService, profileService, $scope, sendFlowService, shapeshiftService, soundService, $state, $timeout, txConfirmNotification, txFormatService, walletService) {
function reviewController(addressbookService, bitcoinCashJsService, bitcore, bitcoreCash, bwcError, clipboardService, configService, feeService, gettextCatalog, $interval, $ionicHistory, $ionicModal, ionicToast, lodash, $log, ongoingProcess, platformInfo, popupService, profileService, $scope, sendFlowService, shapeshiftService, soundService, $state, $timeout, txConfirmNotification, txFormatService, walletService) {
var vm = this;
vm.buttonText = '';
@ -52,6 +52,7 @@ function reviewController(addressbookService, bitcoinCashJsService, bitcore, bit
// Functions
vm.goBack = goBack;
vm.onSuccessConfirm = onSuccessConfirm;
vm.onShareTransaction = onShareTransaction;
var sendFlowData;
var config = null;
@ -62,6 +63,7 @@ function reviewController(addressbookService, bitcoinCashJsService, bitcore, bit
var usingCustomFee = false;
var usingMerchantFee = false;
var destinationWalletId = '';
var lastTxId = '';
var originWalletId = '';
var priceDisplayIsFiat = true;
var satoshis = null;
@ -156,6 +158,7 @@ function reviewController(addressbookService, bitcoinCashJsService, bitcore, bit
txConfirmNotification.subscribe(vm.originWallet, {
txid: txp.txid
});
lastTxId = txp.txid;
}
}, statusChangeHandler);
};
@ -522,6 +525,21 @@ function reviewController(addressbookService, bitcoinCashJsService, bitcore, bit
}
}
function onShareTransaction() {
var explorerTxUrl = 'https://explorer.bitcoin.com/' + tx.coin + '/tx/' + lastTxId;
if (platformInfo.isCordova) {
var text = gettextCatalog.getString('Take a look at this Bitcoin Cash transaction here: ') + explorerTxUrl;
if (coin === 'btc') {
text = gettextCatalog.getString('Take a look at this Bitcoin transaction here: ') + explorerTxUrl;
}
window.plugins.socialsharing.share(text, null, null, null);
} else {
ionicToast.show(gettextCatalog.getString('Copied to clipboard'), 'bottom', false, 3000);
clipboardService.copyToClipboard(explorerTxUrl);
}
}
function startExpirationTimer(expirationTime) {
vm.paymentExpired = false;
setExpirationTime();

View file

@ -25,11 +25,11 @@ angular.module('copayApp.controllers').controller('walletSelectorController', fu
switch($state.current.name) {
case 'tabs.send.wallet-to-wallet':
$scope.sendFlowTitle = gettextCatalog.getString('Wallet to Wallet Transfer');
$scope.sendFlowTitle = gettextCatalog.getString('Transfer between wallets');
break;
case 'tabs.send.destination':
if ($scope.params.fromWalletId && !$scope.params.thirdParty) {
$scope.sendFlowTitle = gettextCatalog.getString('Wallet to Wallet Transfer');
$scope.sendFlowTitle = gettextCatalog.getString('Transfer between wallets');
}
break;
default:

View file

@ -165,7 +165,6 @@
break;
}
$scope.canShow = true;
$scope.$apply();
};
function getDecimalPlaces(currency) {

View file

@ -31,13 +31,13 @@
</p>
</div>
<div ng-show="!showingPaymentReceived" class="amount">
<div ng-show="selectedPriceDisplay=='fiat'">
<div ng-show="selectedPriceDisplay=='crypto'">
<span class="size-36"><formatted-amount value="{{amountUnitStr}}"></formatted-amount></span>
<div class="size-14 amount-alternative">
<formatted-amount value="{{altAmountStr | uppercase}}"></formatted-amount>
</div>
</div>
<div ng-show="selectedPriceDisplay=='crypto'">
<div ng-show="selectedPriceDisplay=='fiat'">
<span class="size-36"><formatted-amount value="{{altAmountStr | uppercase}}"></formatted-amount></span>
<div class="size-14 amount-alternative">
<formatted-amount value="{{amountUnitStr}}"></formatted-amount>

View file

@ -50,7 +50,7 @@
<div class="col-60">
<button class="button button-standard button-primary button-outline" ng-click="startWalletToWalletTransfer()">
<img src="img/icon-w2w.svg"/><br/>
<span translate>Wallet to Wallet Transfer</span>
<span translate>Transfer between wallets</span>
</button>
</div>
</div>