more fixes

This commit is contained in:
Gabriel Bazán 2016-12-13 14:21:57 -03:00
commit ebaefebe8b
8 changed files with 40 additions and 34 deletions

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.controllers').controller('confirmController', function($rootScope, $scope, $interval, $filter, $timeout, $ionicScrollDelegate, gettextCatalog, walletService, platformInfo, lodash, configService, rateService, $stateParams, $window, $state, $log, profileService, bitcore, gettext, txFormatService, ongoingProcess, $ionicModal, popupService, $ionicHistory, $ionicConfig, payproService, feeService, amazonService, glideraService, bwcError, bitpayCardService) {
angular.module('copayApp.controllers').controller('confirmController', function($rootScope, $scope, $interval, $filter, $timeout, $ionicScrollDelegate, gettextCatalog, walletService, platformInfo, lodash, configService, rateService, $stateParams, $window, $state, $log, profileService, bitcore, txFormatService, ongoingProcess, $ionicModal, popupService, $ionicHistory, $ionicConfig, payproService, feeService, amazonService, glideraService, bwcError, bitpayCardService) {
var cachedTxp = {};
var toAmount;
var isChromeApp = platformInfo.isChromeApp;
@ -351,7 +351,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
$timeout(function() {
$scope.$apply();
});
popupService.showAlert(gettextCatalog.getString('Error at confirm'), msg);
popupService.showAlert(gettextCatalog.getString('Error at confirm'), bwcError.msg(msg));
};
function apply(txp) {
@ -373,13 +373,13 @@ angular.module('copayApp.controllers').controller('confirmController', function(
// ToDo: use a credential's (or fc's) function for this
if (description && !wallet.credentials.sharedEncryptingKey) {
var msg = 'Could not add message to imported wallet without shared encrypting key';
var msg = gettextCatalog.getString('Could not add message to imported wallet without shared encrypting key');
$log.warn(msg);
return setSendError(msg);
}
if (toAmount > Number.MAX_SAFE_INTEGER) {
var msg = 'Amount too big';
var msg = gettextCatalog.getString('Amount too big');
$log.warn(msg);
return setSendError(msg);
}

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('createController',
function($scope, $rootScope, $timeout, $log, lodash, $state, $ionicScrollDelegate, $ionicHistory, profileService, configService, gettext, gettextCatalog, ledger, trezor, platformInfo, derivationPathHelper, ongoingProcess, walletService, storageService, popupService) {
function($scope, $rootScope, $timeout, $log, lodash, $state, $ionicScrollDelegate, $ionicHistory, profileService, configService, gettextCatalog, ledger, trezor, platformInfo, derivationPathHelper, ongoingProcess, walletService, storageService, popupService) {
var isChromeApp = platformInfo.isChromeApp;
var isCordova = platformInfo.isCordova;
@ -67,10 +67,10 @@ angular.module('copayApp.controllers').controller('createController',
function updateSeedSourceSelect(n) {
var seedOptions = [{
id: 'new',
label: gettext('Random'),
label: gettextCatalog.getString('Random'),
}, {
id: 'set',
label: gettext('Specify Recovery Phrase...'),
label: gettextCatalog.getString('Specify Recovery Phrase...'),
}];
$scope.seedSource = seedOptions[0];

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('joinController',
function($scope, $rootScope, $timeout, $state, $ionicHistory, $ionicScrollDelegate, profileService, configService, storageService, applicationService, gettext, gettextCatalog, lodash, ledger, trezor, platformInfo, derivationPathHelper, ongoingProcess, walletService, $log, $stateParams, popupService) {
function($scope, $rootScope, $timeout, $state, $ionicHistory, $ionicScrollDelegate, profileService, configService, storageService, applicationService, gettextCatalog, lodash, ledger, trezor, platformInfo, derivationPathHelper, ongoingProcess, walletService, $log, $stateParams, popupService) {
var isChromeApp = platformInfo.isChromeApp;
var isDevel = platformInfo.isDevel;
@ -50,10 +50,10 @@ angular.module('copayApp.controllers').controller('joinController',
var updateSeedSourceSelect = function() {
self.seedOptions = [{
id: 'new',
label: gettext('Random'),
label: gettextCatalog.getString('Random'),
}, {
id: 'set',
label: gettext('Specify Recovery Phrase...'),
label: gettextCatalog.getString('Specify Recovery Phrase...'),
}];
$scope.seedSource = self.seedOptions[0];

View file

@ -107,7 +107,7 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi
}
}
var setError = function (err, prefix) {
var setError = function(err, prefix) {
$scope.sendStatus = '';
$scope.loading = false;
popupService.showAlert(gettextCatalog.getString('Error'), bwcError.msg(err, prefix));
@ -164,9 +164,9 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi
$scope.loading = true;
$timeout(function() {
ongoingProcess.set('broadcastTx', true);
ongoingProcess.set('broadcastingTx', true);
walletService.broadcastTx($scope.wallet, $scope.tx, function(err, txpb) {
ongoingProcess.set('broadcastTx', false);
ongoingProcess.set('broadcastingTx', false);
if (err) {
return setError(err, gettextCatalog.getString('Could not broadcast payment'));
@ -185,7 +185,7 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi
$scope.wallet.getTx($scope.tx.id, function(err, tx) {
if (err) {
if (err.message && err.message == 'Transaction proposal not found' &&
(eventName == 'transactionProposalRemoved' || eventName == 'TxProposalRemoved')) {
(eventName == 'transactionProposalRemoved' || eventName == 'TxProposalRemoved')) {
$scope.tx.removed = true;
$scope.tx.canBeRemoved = false;
$scope.tx.pendingForUs = false;
@ -209,7 +209,7 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi
});
};
var bwsEvent = $rootScope.$on('bwsEvent', function(e, walletId, type, n) {
var bwsEvent = $rootScope.$on('bwsEvent', function(e, walletId, type, n) {
lodash.each([
'TxProposalRejectedBy',
'TxProposalAcceptedBy',

View file

@ -56,6 +56,8 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
force: !!force,
}, function(err, status) {
$scope.updatingStatus = false;
console.log(err);
console.log("####################12412412");
if (err) {
if (err === 'WALLET_NOT_REGISTERED') {
$scope.walletNotRegistered = true;