new onGoingProcess

This commit is contained in:
Matias Alejo Garcia 2016-06-13 15:25:40 -03:00
commit 90dad5b2a8
No known key found for this signature in database
GPG key ID: 02470DB551277AB3
33 changed files with 200 additions and 267 deletions

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('createController',
function($scope, $ionicScrollDelegate, $rootScope, $timeout, $log, lodash, go, profileService, configService, gettext, ledger, trezor, platformInfo, derivationPathHelper) {
function($scope, $ionicScrollDelegate, $rootScope, $timeout, $log, lodash, go, profileService, configService, gettext, ledger, trezor, platformInfo, derivationPathHelper, ongoingProcess) {
var isChromeApp = platformInfo.isChromeApp;
var isCordova = platformInfo.isCordova;
@ -147,11 +147,12 @@ angular.module('copayApp.controllers').controller('createController',
account = account - 1;
opts.account = account;
self.hwWallet = self.seedSourceId == 'ledger' ? 'Ledger' : 'Trezor';
ongoingProcess.set('connecting' + self.seedSourceId, true);
var src = self.seedSourceId == 'ledger' ? ledger : trezor;
src.getInfoForNewWallet(opts.n > 1, account, function(err, lopts) {
self.hwWallet = false;
ongoingProcess.set('connecting' + self.seedSourceId, false);
if (err) {
self.error = err;
$ionicScrollDelegate.scrollTop();
@ -167,11 +168,11 @@ angular.module('copayApp.controllers').controller('createController',
};
this._create = function(opts) {
self.loading = true;
ongoingProcess.set('creatingWallet', true);
$timeout(function() {
profileService.createWallet(opts, function(err) {
self.loading = false;
ongoingProcess.set('creatingWallet', false);
if (err) {
$log.warn(err);
self.error = err;