Changed the review controller to allow the transaction to be shared, once successful.
This commit is contained in:
parent
9b5f4b3516
commit
05e204dec8
1 changed files with 19 additions and 1 deletions
|
|
@ -4,7 +4,7 @@ angular
|
||||||
.module('copayApp.controllers')
|
.module('copayApp.controllers')
|
||||||
.controller('reviewController', reviewController);
|
.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;
|
var vm = this;
|
||||||
|
|
||||||
vm.buttonText = '';
|
vm.buttonText = '';
|
||||||
|
|
@ -52,6 +52,7 @@ function reviewController(addressbookService, bitcoinCashJsService, bitcore, bit
|
||||||
// Functions
|
// Functions
|
||||||
vm.goBack = goBack;
|
vm.goBack = goBack;
|
||||||
vm.onSuccessConfirm = onSuccessConfirm;
|
vm.onSuccessConfirm = onSuccessConfirm;
|
||||||
|
vm.onShareTransaction = onShareTransaction;
|
||||||
|
|
||||||
var sendFlowData;
|
var sendFlowData;
|
||||||
var config = null;
|
var config = null;
|
||||||
|
|
@ -62,6 +63,7 @@ function reviewController(addressbookService, bitcoinCashJsService, bitcore, bit
|
||||||
var usingCustomFee = false;
|
var usingCustomFee = false;
|
||||||
var usingMerchantFee = false;
|
var usingMerchantFee = false;
|
||||||
var destinationWalletId = '';
|
var destinationWalletId = '';
|
||||||
|
var lastTxId = '';
|
||||||
var originWalletId = '';
|
var originWalletId = '';
|
||||||
var priceDisplayIsFiat = true;
|
var priceDisplayIsFiat = true;
|
||||||
var satoshis = null;
|
var satoshis = null;
|
||||||
|
|
@ -156,6 +158,7 @@ function reviewController(addressbookService, bitcoinCashJsService, bitcore, bit
|
||||||
txConfirmNotification.subscribe(vm.originWallet, {
|
txConfirmNotification.subscribe(vm.originWallet, {
|
||||||
txid: txp.txid
|
txid: txp.txid
|
||||||
});
|
});
|
||||||
|
lastTxId = txp.txid;
|
||||||
}
|
}
|
||||||
}, statusChangeHandler);
|
}, 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) {
|
function startExpirationTimer(expirationTime) {
|
||||||
vm.paymentExpired = false;
|
vm.paymentExpired = false;
|
||||||
setExpirationTime();
|
setExpirationTime();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue