Uses popupService

This commit is contained in:
Gustavo Maximiliano Cortez 2016-09-01 10:56:13 -03:00
commit 92bb8e01bc
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
19 changed files with 64 additions and 164 deletions

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.services').factory('walletService', function($log, $timeout, lodash, trezor, ledger, storageService, configService, rateService, uxLanguage, $filter, gettextCatalog, bwcError, $ionicPopup, fingerprintService, ongoingProcess, gettext, $rootScope, txStatus, txFormatService, $ionicModal, $state, bwcService, bitcore) {
angular.module('copayApp.services').factory('walletService', function($log, $timeout, lodash, trezor, ledger, storageService, configService, rateService, uxLanguage, $filter, gettextCatalog, bwcError, $ionicPopup, fingerprintService, ongoingProcess, gettext, $rootScope, txStatus, txFormatService, $ionicModal, $state, bwcService, bitcore, popupService) {
// `wallet` is a decorated version of client.
var root = {};
@ -81,12 +81,11 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
wallet.notAuthorized = true;
$state.go('tabs.home');
} else if (err instanceof errors.NOT_FOUND) {
root.showErrorPopup(gettext('Could not access Wallet Service: Not found'));
popupService.showAlert(gettextCatalog.getString('Could not access Wallet Service: Not found'));
} else {
var msg = ""
$rootScope.$emit('Local/ClientError', (err.error ? err.error : err));
var msg = bwcError.msg(err, gettext('Error at Wallet Service'));
root.showErrorPopup(msg);
popupService.showAlert(bwcError.msg(err, gettextCatalog.getString('Error at Wallet Service')));
}
};
root.handleError = lodash.debounce(_handleError, 1000);
@ -664,20 +663,6 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
});
};
root.showErrorPopup = function(msg, cb) {
$log.warn('Showing err popup:' + msg);
// An alert dialog
var alertPopup = $ionicPopup.alert({
title: title,
template: msg
});
if (!cb) cb = function() {};
alertPopup.then(cb);
};
// walletHome
root.recreate = function(wallet, cb) {
ongoingProcess.set('recreating', true);