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('joinController',
function($scope, $rootScope, $timeout, $ionicScrollDelegate, go, notification, profileService, configService, storageService, applicationService, $modal, gettext, lodash, ledger, trezor, platformInfo, derivationPathHelper) {
function($scope, $rootScope, $timeout, $ionicScrollDelegate, go, notification, profileService, configService, storageService, applicationService, $modal, gettext, lodash, ledger, trezor, platformInfo, derivationPathHelper, ongoingProcess) {
var isChromeApp = platformInfo.isChromeApp;
var isDevel = platformInfo.isDevel;
@ -108,11 +108,11 @@ angular.module('copayApp.controllers').controller('joinController',
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(true, account, function(err, lopts) {
self.hwWallet = false;
ongoingProcess.set('connecting' + self.seedSourceId, false);
if (err) {
self.error = err;
$ionicScrollDelegate.scrollTop();
@ -129,11 +129,11 @@ angular.module('copayApp.controllers').controller('joinController',
};
this._join = function(opts) {
self.loading = true;
ongoingProcess.set('joiningWallet', true);
$timeout(function() {
profileService.joinWallet(opts, function(err) {
if (err) {
self.loading = false;
ongoingProcess.set('joiningWallet', false);
self.error = err;
$ionicScrollDelegate.scrollTop();
$rootScope.$apply();