Fix Tx-defailts on iOS. Smoother transition

This commit is contained in:
Gustavo Maximiliano Cortez 2017-03-10 12:00:57 -03:00
parent aace2f39f8
commit 3d1b79418a
No known key found for this signature in database
GPG Key ID: 15EDAD8D9F2EB1AF
2 changed files with 17 additions and 16 deletions

View File

@ -17,7 +17,7 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio
listeners = [ listeners = [
$rootScope.$on('bwsEvent', function(e, walletId, type, n) { $rootScope.$on('bwsEvent', function(e, walletId, type, n) {
if (type == 'NewBlock' && n && n.data && n.data.network == 'livenet') { if (type == 'NewBlock' && n && n.data && n.data.network == 'livenet') {
updateTx(); updateTx({hideLoading: true});
} }
}) })
]; ];
@ -88,10 +88,11 @@ angular.module('copayApp.controllers').controller('txDetailsController', functio
}, 10); }, 10);
} }
var updateTx = function() { var updateTx = function(opts) {
ongoingProcess.set('loadingTxInfo', true); opts = opts || {};
if (!opts.hideLoading) ongoingProcess.set('loadingTxInfo', true);
walletService.getTx($scope.wallet, txId, function(err, tx) { walletService.getTx($scope.wallet, txId, function(err, tx) {
ongoingProcess.set('loadingTxInfo', false); if (!opts.hideLoading) ongoingProcess.set('loadingTxInfo', false);
if (err) { if (err) {
$log.warn('Error getting transaction' + err); $log.warn('Error getting transaction' + err);
$ionicHistory.goBack(); $ionicHistory.goBack();

View File

@ -7,8 +7,8 @@
</ion-nav-back-button> </ion-nav-back-button>
</ion-nav-bar> </ion-nav-bar>
<ion-content class="tx-details-content" ng-show="btx"> <ion-content class="tx-details-content">
<div class="list"> <div class="list" ng-if="btx">
<div class="item head"> <div class="item head">
<div class="sending-label" ng-if="btx.confirmations > 0"> <div class="sending-label" ng-if="btx.confirmations > 0">
<img src="img/icon-tx-sent-outline.svg" ng-if="btx.action === 'sent'"> <img src="img/icon-tx-sent-outline.svg" ng-if="btx.action === 'sent'">
@ -26,10 +26,10 @@
<div class="amount-label"> <div class="amount-label">
<div class="amount">{{displayAmount}} <span class="unit">{{displayUnit}}</span></div> <div class="amount">{{displayAmount}} <span class="unit">{{displayUnit}}</span></div>
<div class="alternative" ng-click="showRate = !showRate"> <div class="alternative" ng-click="showRate = !showRate">
<span ng-show="!showRate">{{btx.alternativeAmountStr}}</span> <span ng-if="!showRate">{{btx.alternativeAmountStr}}</span>
<span ng-show="showRate"> <span ng-if="showRate">
<span ng-show="!rate">...</span> <span ng-if="!rate">...</span>
<span ng-show="rate"> <span ng-if="rate">
{{rate| currency:'':2}} {{alternativeIsoCode}} ({{rateDate | amDateFormat:'MM/DD/YYYY HH:mm a'}}) {{rate| currency:'':2}} {{alternativeIsoCode}} ({{rateDate | amDateFormat:'MM/DD/YYYY HH:mm a'}})
</span> </span>
</span> </span>
@ -80,20 +80,20 @@
<div class="item single-line" ng-click="toggleFeeFiat = !toggleFeeFiat"> <div class="item single-line" ng-click="toggleFeeFiat = !toggleFeeFiat">
<span class="label" translate>Fee</span> <span class="label" translate>Fee</span>
<span class="item-note"> <span class="item-note">
<span ng-show="!toggleFeeFiat">{{btx.feeStr}}</span> <span ng-if="!toggleFeeFiat">{{btx.feeStr}}</span>
<span ng-show="toggleFeeFiat">{{feeFiatStr}}</span> <span ng-if="toggleFeeFiat">{{feeFiatStr}}</span>
</span> </span>
</div> </div>
<div class="item single-line"> <div class="item single-line">
<span class="label" translate>Confirmations</span> <span class="label" translate>Confirmations</span>
<span class="item-note"> <span class="item-note">
<span ng-show="!btx.confirmations || btx.confirmations == 0" translate> <span ng-if="!btx.confirmations || btx.confirmations == 0" translate>
Unconfirmed Unconfirmed
</span> </span>
<span ng-show="btx.confirmations>0 && !btx.safeConfirmed"> <span ng-if="btx.confirmations>0 && !btx.safeConfirmed">
{{btx.confirmations}} {{btx.confirmations}}
</span> </span>
<span ng-show="btx.safeConfirmed"> <span ng-if="btx.safeConfirmed">
{{btx.safeConfirmed}} {{btx.safeConfirmed}}
</span> </span>
</span> </span>
@ -125,7 +125,7 @@
</div> </div>
<button class="view-on-blockchain-btn button button-standard button-primary" ng-click="viewOnBlockchain()" translate> <button ng-if="btx" class="view-on-blockchain-btn button button-standard button-primary" ng-click="viewOnBlockchain()" translate>
View on blockchain View on blockchain
</button> </button>