Fix Get Started message. Fix when tx is empty. Enable keyboard accessory bar for iOS
This commit is contained in:
parent
13d85c193d
commit
2e9b9d7443
5 changed files with 37 additions and 25 deletions
|
|
@ -6,15 +6,12 @@ angular.module('copayApp.controllers').controller('bitpayCardController', functi
|
|||
$scope.dateRange = { value: 'last30Days'};
|
||||
$scope.network = bitpayCardService.getEnvironment();
|
||||
|
||||
var getFromCache = function(cb) {
|
||||
$scope.loadingCache = true;
|
||||
var getFromCache = function() {
|
||||
bitpayCardService.getBitpayDebitCardsHistory($scope.cardId, function(err, data) {
|
||||
$scope.loadingCache = false;
|
||||
if (err || lodash.isEmpty(data)) return cb();
|
||||
if (err || lodash.isEmpty(data)) return;
|
||||
$scope.historyCached = true;
|
||||
self.bitpayCardTransactionHistory = data.transactions;
|
||||
self.bitpayCardCurrentBalance = data.balance;
|
||||
return cb();
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -43,18 +40,28 @@ angular.module('copayApp.controllers').controller('bitpayCardController', functi
|
|||
};
|
||||
};
|
||||
|
||||
var setGetStarted = function() {
|
||||
var dateRange = setDateRange('all');
|
||||
bitpayCardService.getHistory($scope.cardId, dateRange, function(err, history) {
|
||||
if (lodash.isEmpty(history.transactionList)) self.getStarted = true;
|
||||
});
|
||||
};
|
||||
|
||||
this.update = function() {
|
||||
var dateRange = setDateRange($scope.dateRange.value);
|
||||
|
||||
$scope.loadingHistory = true;
|
||||
bitpayCardService.getHistory($scope.cardId, dateRange, function(err, history) {
|
||||
$scope.loadingHistory = false;
|
||||
|
||||
if (err) {
|
||||
$log.error(err);
|
||||
$scope.error = gettextCatalog.getString('Could not get transactions');
|
||||
return;
|
||||
}
|
||||
|
||||
if (lodash.isEmpty(history.transactionList)) setGetStarted();
|
||||
|
||||
var txs = lodash.clone(history.txs);
|
||||
for (var i = 0; i < txs.length; i++) {
|
||||
txs[i] = _getMerchantInfo(txs[i]);
|
||||
|
|
@ -114,11 +121,13 @@ angular.module('copayApp.controllers').controller('bitpayCardController', functi
|
|||
$state.go('tabs.home');
|
||||
popupService.showAlert(null, msg);
|
||||
} else {
|
||||
getFromCache(function() {
|
||||
self.update();
|
||||
});
|
||||
getFromCache();
|
||||
}
|
||||
});
|
||||
|
||||
$scope.$on("$ionicView.afterEnter", function(event, data) {
|
||||
self.update();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ angular.module('copayApp.controllers').controller('bitpayCardIntroController', f
|
|||
|
||||
var checkOtp = function(obj, cb) {
|
||||
if (obj.otp) {
|
||||
var msg = gettextCatalog.getString('Enter Two Factor for BitPay Cards');
|
||||
var msg = gettextCatalog.getString('Enter Two Factor for BitPay Card');
|
||||
popupService.showPrompt(null, msg, null, function(res) {
|
||||
cb(res);
|
||||
});
|
||||
|
|
@ -27,7 +27,7 @@ angular.module('copayApp.controllers').controller('bitpayCardIntroController', f
|
|||
popupService.showAlert(null, err);
|
||||
return;
|
||||
}
|
||||
var title = gettextCatalog.getString('Add BitPay Cards?');
|
||||
var title = gettextCatalog.getString('Add BitPay Card?');
|
||||
var msg = gettextCatalog.getString('Would you like to add this account ({{email}}) to your wallet?', {email: obj.email});
|
||||
var ok = gettextCatalog.getString('Add cards');
|
||||
var cancel = gettextCatalog.getString('Go back');
|
||||
|
|
|
|||
|
|
@ -905,7 +905,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
screen.lockOrientation('portrait');
|
||||
|
||||
if (window.cordova && window.cordova.plugins && window.cordova.plugins.Keyboard) {
|
||||
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
|
||||
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(false);
|
||||
cordova.plugins.Keyboard.disableScroll(true);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue