Fix priority normal for bch transactions

This commit is contained in:
Gustavo Maximiliano Cortez 2017-08-28 18:01:07 -03:00
commit db04a31a06
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
3 changed files with 23 additions and 13 deletions

View file

@ -119,6 +119,11 @@ angular.module('copayApp.controllers').controller('confirmController', function(
});
};
// TODO: Default fee level for BCH
if (data.stateParams.coin == 'bch') {
configFeeLevel = 'normal';
}
// Setup $scope
// Grab stateParams
@ -142,13 +147,11 @@ angular.module('copayApp.controllers').controller('confirmController', function(
txp: {},
};
// Other Scope vars
$scope.isCordova = isCordova;
$scope.isWindowsPhoneApp = isWindowsPhoneApp;
$scope.showAddress = false;
$scope.walletSelectorTitle = gettextCatalog.getString('Send from');
setWalletSelector(tx.coin, tx.network, tx.toAmount, function(err) {
@ -563,6 +566,8 @@ angular.module('copayApp.controllers').controller('confirmController', function(
$scope.chooseFeeLevel = function(tx, wallet) {
if (wallet.coin == 'bch') return;
var scope = $rootScope.$new(true);
scope.network = tx.network;
scope.feeLevel = tx.feeLevel;

View file

@ -91,6 +91,9 @@ angular.module('copayApp.services')
wallet.n = wallet.credentials.n;
wallet.coin = wallet.credentials.coin ? wallet.credentials.coin : 'btc';
// TODO
if (wallet.id == 'bf338d5b-6b2e-4118-adb0-6208c2d22a81') wallet.credentials.coin = wallet.coin = 'bch';
root.updateWalletSettings(wallet);
root.wallet[walletId] = wallet;
@ -864,7 +867,7 @@ angular.module('copayApp.services')
});
};
function process(wallet, notifications) {
function process(notifications) {
if (!notifications) return [];
var shown = lodash.sortBy(notifications, 'createdOn').reverse();
@ -877,7 +880,7 @@ angular.module('copayApp.services')
x.types = [x.type];
if (x.data && x.data.amount)
x.amountStr = txFormatService.formatAmountStr(wallet.coin, x.data.amount);
x.amountStr = txFormatService.formatAmountStr(x.wallet.coin, x.data.amount);
x.action = function() {
// TODO?
@ -955,7 +958,7 @@ angular.module('copayApp.services')
notifications = lodash.sortBy(notifications, 'createdOn');
notifications = lodash.compact(lodash.flatten(notifications)).slice(0, MAX);
var total = notifications.length;
return cb(null, process(wallet, notifications), total);
return cb(null, process(notifications), total);
};
});
});

View file

@ -79,18 +79,20 @@
</a>
<div class="item item-icon-right" ng-if="wallet" ng-click="chooseFeeLevel(tx, wallet)">
<span class="label">{{'Fee:' | translate}} {{tx.feeLevelName | translate}}</span>
<span class="m10l">{{tx.txp[wallet.id].feeStr || '...'}}</span>
<span class="item-note m10l">
<span>{{tx.txp[wallet.id].alternativeFeeStr || '...'}}&nbsp;
<span class="fee-rate" ng-if="tx.txp[wallet.id].feeRatePerStr"> &middot;
<i class="ion-alert-circled warn" ng-show="tx.txp[wallet.id].feeToHigh"></i> &nbsp;
<span class="fee-rate" ng-class="{'warn':tx.txp[wallet.id].feeToHigh}" translate> {{tx.txp[wallet.id].feeRatePerStr}} of the sending amount </span>
<span ng-if="wallet.coin == 'btc'">
<span class="m10l">{{tx.txp[wallet.id].feeStr || '...'}}</span>
<span class="item-note m10l">
<span>{{tx.txp[wallet.id].alternativeFeeStr || '...'}}&nbsp;
<span class="fee-rate" ng-if="tx.txp[wallet.id].feeRatePerStr"> &middot;
<i class="ion-alert-circled warn" ng-show="tx.txp[wallet.id].feeToHigh"></i> &nbsp;
<span class="fee-rate" ng-class="{'warn':tx.txp[wallet.id].feeToHigh}" translate> {{tx.txp[wallet.id].feeRatePerStr}} of the sending amount </span>
</span>
</span>
</span>
</span>
</span>
<i class="icon bp-arrow-right"></i>
<i ng-if="wallet.coin == 'btc'" class="icon bp-arrow-right"></i>
</div>
<a class="item item-icon-right" ng-if="wallet" ng-click="showDescriptionPopup(tx)">
<span class="label" translate>Add Memo</span>