This commit is contained in:
Matias Alejo Garcia 2016-08-19 13:07:18 -03:00
commit a8cf875def
No known key found for this signature in database
GPG key ID: 02470DB551277AB3
22 changed files with 53 additions and 1392 deletions

View file

@ -163,7 +163,7 @@
<button <button
class="button round expand" class="button round expand"
href ui-sref="walletHome" href ui-sref="tabs.home"
translate>Finish translate>Finish
</button> </button>
<!-- hide this in multisig just to show less text --> <!-- hide this in multisig just to show less text -->

View file

@ -104,10 +104,10 @@
<div translate> <div translate>
Only Main (not change) addresses are shown. The addresses on this list were not verified locally at this time. Only Main (not change) addresses are shown. The addresses on this list were not verified locally at this time.
</div> </div>
<button class="button button-block" ng-style="{'color':wallet.color}" href ui-sref="walletHome" ng-click="index.retryScan()" translate> <button class="button button-block button-positive" href ui-sref="walletHome" ng-click="scan()" translate>
Scan addresses for funds Scan addresses for funds
</button> </button>
<button class="button button-block" ng-style="{'color':wallet.color}" ng-show="isCordova" ng-click="sendAddrs()" translate> <button class="button button-block button-positive" ng-show="isCordova" ng-click="sendAddrs()" translate>
Send addresses by email Send addresses by email
</button> </button>

View file

@ -4,27 +4,25 @@ angular.module('copayApp.controllers').controller('backupController',
function($rootScope, $scope, $timeout, $log, $state, lodash, fingerprintService, platformInfo, configService, profileService, gettext, bwcService, walletService, ongoingProcess) { function($rootScope, $scope, $timeout, $log, $state, lodash, fingerprintService, platformInfo, configService, profileService, gettext, bwcService, walletService, ongoingProcess) {
var fc = profileService.focusedClient; var fc = profileService.focusedClient;
var prevState;
$scope.customWords = []; $scope.customWords = [];
$scope.walletName = fc.credentials.walletName; $scope.walletName = fc.credentials.walletName;
$scope.credentialsEncrypted = fc.isPrivKeyEncrypted; $scope.credentialsEncrypted = fc.isPrivKeyEncrypted;
$scope.init = function(state) { $scope.init = function() {
prevState = state || 'walletHome';
$scope.step = 1; $scope.step = 1;
$scope.deleted = isDeletedSeed(); $scope.deleted = isDeletedSeed();
if ($scope.deleted) return; if ($scope.deleted) return;
fingerprintService.check(fc, function(err) { fingerprintService.check(fc, function(err) {
if (err) { if (err) {
go.path(prevState); $state.go('tabs.home')
return; return;
} }
handleEncryptedWallet(fc, function(err) { handleEncryptedWallet(fc, function(err) {
if (err) { if (err) {
$log.warn('Error decrypting credentials:', $scope.error); $log.warn('Error decrypting credentials:', $scope.error);
go.path(prevState); $state.go('tabs.home')
return; return;
} }
$scope.credentialsEncrypted = false; $scope.credentialsEncrypted = false;

View file

@ -1,7 +1,7 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('copayersController', angular.module('copayApp.controllers').controller('copayersController',
function($scope, $rootScope, $timeout, $log, $ionicModal, profileService, go, notification, platformInfo, gettext, gettextCatalog, $stateParams, $state) { function($scope, $rootScope, $timeout, $log, $ionicModal, profileService, $state, notification, platformInfo, gettext, gettextCatalog, $stateParams, $state) {
var self = this; var self = this;
$scope.isCordova = platformInfo.isCordova; $scope.isCordova = platformInfo.isCordova;
var isWP = platformInfo.isWP; var isWP = platformInfo.isWP;
@ -39,7 +39,7 @@ angular.module('copayApp.controllers').controller('copayersController',
$scope.$digest(); $scope.$digest();
}); });
} else { } else {
go.walletHome(); $state.go('tabs.home');
$timeout(function() { $timeout(function() {
notification.success( notification.success(
gettextCatalog.getString('Success'), gettextCatalog.getString('Success'),

View file

@ -1,7 +1,7 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('createController', angular.module('copayApp.controllers').controller('createController',
function($scope, $rootScope, $timeout, $log, lodash, go, profileService, configService, gettext, ledger, trezor, platformInfo, derivationPathHelper, ongoingProcess, walletService) { function($scope, $rootScope, $timeout, $log, lodash, $state, profileService, configService, gettext, ledger, trezor, platformInfo, derivationPathHelper, ongoingProcess, walletService) {
var isChromeApp = platformInfo.isChromeApp; var isChromeApp = platformInfo.isChromeApp;
var isCordova = platformInfo.isCordova; var isCordova = platformInfo.isCordova;
@ -187,8 +187,7 @@ angular.module('copayApp.controllers').controller('createController',
$rootScope.$emit('Local/BackupDone'); $rootScope.$emit('Local/BackupDone');
}, 1); }, 1);
} }
$state.go('tabs.home')
go.walletHome();
}); });
}, 100); }, 100);
} }

View file

@ -1,7 +1,7 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('disclaimerController', angular.module('copayApp.controllers').controller('disclaimerController',
function($scope, $rootScope, $timeout, $log, $ionicSideMenuDelegate, profileService, applicationService, gettextCatalog, uxLanguage, go, storageService, gettext, platformInfo, ongoingProcess) { function($scope, $rootScope, $timeout, $log, $ionicSideMenuDelegate, profileService, applicationService, gettextCatalog, uxLanguage, $state, storageService, gettext, platformInfo, ongoingProcess) {
var tries = 0; var tries = 0;
var isCordova = platformInfo.isCordova; var isCordova = platformInfo.isCordova;
@ -49,7 +49,7 @@ angular.module('copayApp.controllers').controller('disclaimerController',
if (!err || !err.message || !err.message.match('NONAGREEDDISCLAIMER')) { if (!err || !err.message || !err.message.match('NONAGREEDDISCLAIMER')) {
$log.debug('Disclaimer already accepted at #disclaimer. Redirect to Wallet Home.'); $log.debug('Disclaimer already accepted at #disclaimer. Redirect to Wallet Home.');
$ionicSideMenuDelegate.canDragContent(true); $ionicSideMenuDelegate.canDragContent(true);
go.walletHome(); $state.go('tabs.home');
} }
}); });
} }
@ -62,7 +62,7 @@ angular.module('copayApp.controllers').controller('disclaimerController',
else { else {
$ionicSideMenuDelegate.canDragContent(true); $ionicSideMenuDelegate.canDragContent(true);
$rootScope.$emit('disclaimerAccepted'); $rootScope.$emit('disclaimerAccepted');
go.walletHome(); $state.go('tabs.home');
} }
}); });
}; };

View file

@ -1,7 +1,7 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('exportController', angular.module('copayApp.controllers').controller('exportController',
function($rootScope, $scope, $timeout, $log, lodash, backupService, walletService, storageService, profileService, platformInfo, notification, go, gettext, gettextCatalog, $state, $stateParams) { function($rootScope, $scope, $timeout, $log, lodash, backupService, walletService, storageService, profileService, platformInfo, notification, gettext, gettextCatalog, $state, $stateParams) {
var prevState; var prevState;
var isWP = platformInfo.isWP; var isWP = platformInfo.isWP;
var isAndroid = platformInfo.isAndroid; var isAndroid = platformInfo.isAndroid;
@ -69,7 +69,7 @@ angular.module('copayApp.controllers').controller('exportController',
return; return;
} }
notification.success(gettext('Success'), gettext('Encrypted export file saved')); notification.success(gettext('Success'), gettext('Encrypted export file saved'));
go.walletHome(); $state.go('tabs.home');
}); });
}); });
}; };

View file

@ -1,7 +1,7 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('importController', angular.module('copayApp.controllers').controller('importController',
function($scope, $rootScope, $timeout, $log, profileService, configService, notification, go, sjcl, gettext, ledger, trezor, derivationPathHelper, platformInfo, bwcService, ongoingProcess, walletService) { function($scope, $rootScope, $timeout, $log, profileService, configService, notification, sjcl, gettext, ledger, trezor, derivationPathHelper, platformInfo, bwcService, ongoingProcess, walletService) {
var isChromeApp = platformInfo.isChromeApp; var isChromeApp = platformInfo.isChromeApp;
var isDevel = platformInfo.isDevel; var isDevel = platformInfo.isDevel;
@ -111,7 +111,7 @@ angular.module('copayApp.controllers').controller('importController',
$rootScope.$emit('Local/WalletImported', client.credentials.walletId); $rootScope.$emit('Local/WalletImported', client.credentials.walletId);
notification.success(gettext('Success'), gettext('Your wallet has been imported correctly')); notification.success(gettext('Success'), gettext('Your wallet has been imported correctly'));
go.walletHome(); $state.go('tabs.home');
}); });
}, 100); }, 100);
}; };
@ -139,7 +139,7 @@ angular.module('copayApp.controllers').controller('importController',
$rootScope.$emit('Local/WalletImported', client.credentials.walletId); $rootScope.$emit('Local/WalletImported', client.credentials.walletId);
notification.success(gettext('Success'), gettext('Your wallet has been imported correctly')); notification.success(gettext('Success'), gettext('Your wallet has been imported correctly'));
go.walletHome(); $state.go('tabs.home');
}); });
}, 100); }, 100);
}; };
@ -160,7 +160,7 @@ angular.module('copayApp.controllers').controller('importController',
} }
$rootScope.$emit('Local/WalletImported', walletId); $rootScope.$emit('Local/WalletImported', walletId);
notification.success(gettext('Success'), gettext('Your wallet has been imported correctly')); notification.success(gettext('Success'), gettext('Your wallet has been imported correctly'));
go.walletHome(); $state.go('tabs.home');
}); });
}, 100); }, 100);
}; };
@ -190,7 +190,7 @@ angular.module('copayApp.controllers').controller('importController',
$rootScope.$emit('Local/WalletImported', client.credentials.walletId); $rootScope.$emit('Local/WalletImported', client.credentials.walletId);
notification.success(gettext('Success'), gettext('Your wallet has been imported correctly')); notification.success(gettext('Success'), gettext('Your wallet has been imported correctly'));
go.walletHome(); $state.go('tabs.home');
}); });
}, 100); }, 100);
}; };
@ -325,7 +325,7 @@ angular.module('copayApp.controllers').controller('importController',
}); });
$rootScope.$emit('Local/WalletImported', wallet.walletId); $rootScope.$emit('Local/WalletImported', wallet.walletId);
notification.success(gettext('Success'), gettext('Your wallet has been imported correctly')); notification.success(gettext('Success'), gettext('Your wallet has been imported correctly'));
go.walletHome(); $state.go('tabs.home');
}); });
}, 100); }, 100);
}; };
@ -403,7 +403,7 @@ angular.module('copayApp.controllers').controller('importController',
}); });
$rootScope.$emit('Local/WalletImported', wallet.walletId); $rootScope.$emit('Local/WalletImported', wallet.walletId);
notification.success(gettext('Success'), gettext('Your wallet has been imported correctly')); notification.success(gettext('Success'), gettext('Your wallet has been imported correctly'));
go.walletHome(); $state.go('tabs.home');
}); });
}, 100); }, 100);
}; };

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,7 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('joinController', angular.module('copayApp.controllers').controller('joinController',
function($scope, $rootScope, $timeout, go, notification, profileService, configService, storageService, applicationService, gettext, lodash, ledger, trezor, platformInfo, derivationPathHelper, ongoingProcess, walletService, $log) { function($scope, $rootScope, $timeout, $state, notification, profileService, configService, storageService, applicationService, gettext, lodash, ledger, trezor, platformInfo, derivationPathHelper, ongoingProcess, walletService, $log) {
var isChromeApp = platformInfo.isChromeApp; var isChromeApp = platformInfo.isChromeApp;
var isDevel = platformInfo.isDevel; var isDevel = platformInfo.isDevel;
@ -140,7 +140,7 @@ angular.module('copayApp.controllers').controller('joinController',
$log.debug('Remote preferences saved for:' + client.credentials.walletId) $log.debug('Remote preferences saved for:' + client.credentials.walletId)
}); });
go.walletHome(); $state.go('tabs.home');
}); });
}, 100); }, 100);
}; };

View file

@ -1,5 +1,5 @@
angular.module('copayApp.controllers').controller('paperWalletController', angular.module('copayApp.controllers').controller('paperWalletController',
function($scope, $timeout, $log, $ionicModal, configService, profileService, go, addressService, txStatus, bitcore, ongoingProcess, txFormatService) { function($scope, $timeout, $log, $ionicModal, configService, profileService, $state, addressService, txStatus, bitcore, ongoingProcess, txFormatService) {
var fc = profileService.focusedClient; var fc = profileService.focusedClient;
var rawTx; var rawTx;
@ -102,7 +102,7 @@ angular.module('copayApp.controllers').controller('paperWalletController',
} else { } else {
var type = txStatus.notify(txp); var type = txStatus.notify(txp);
$scope.openStatusModal(type, txp, function() { $scope.openStatusModal(type, txp, function() {
go.walletHome(); $state.go('tabs.home');
}); });
} }
$scope.$apply(); $scope.$apply();

View file

@ -1,6 +1,6 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('paymentUriController', angular.module('copayApp.controllers').controller('paymentUriController',
function($rootScope, $scope, $stateParams, $location, $timeout, profileService, configService, lodash, bitcore, go) { function($rootScope, $scope, $stateParams, $location, $timeout, profileService, configService, lodash, bitcore, $state) {
function strip(number) { function strip(number) {
return (parseFloat(number.toPrecision(12))); return (parseFloat(number.toPrecision(12)));
}; };
@ -47,7 +47,7 @@ angular.module('copayApp.controllers').controller('paymentUriController',
this.selectWallet = function(wid) { this.selectWallet = function(wid) {
var self = this; var self = this;
profileService.setAndStoreFocus(wid, function() {}); profileService.setAndStoreFocus(wid, function() {});
go.walletHome(); $state.go('tabs.home');
$timeout(function() { $timeout(function() {
$rootScope.$emit('paymentUri', self.bitcoinURI); $rootScope.$emit('paymentUri', self.bitcoinURI);
}, 1000); }, 1000);

View file

@ -1,7 +1,7 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('preferencesDeleteWalletController', angular.module('copayApp.controllers').controller('preferencesDeleteWalletController',
function($scope, $rootScope, $filter, $timeout, $log, $ionicModal, storageService, notification, profileService, platformInfo, go, gettext, gettextCatalog, applicationService, ongoingProcess) { function($scope, $rootScope, $filter, $timeout, $log, $ionicModal, storageService, notification, profileService, platformInfo, $state, gettext, gettextCatalog, applicationService, ongoingProcess) {
var isCordova = platformInfo.isCordova; var isCordova = platformInfo.isCordova;
$scope.isCordova = isCordova; $scope.isCordova = isCordova;
$scope.error = null; $scope.error = null;
@ -38,7 +38,7 @@ angular.module('copayApp.controllers').controller('preferencesDeleteWalletContro
if (err) { if (err) {
$scope.error = err.message || err; $scope.error = err.message || err;
} else { } else {
go.walletHome(); $state.go('tabs.home');
notification.success(gettextCatalog.getString('Success'), gettextCatalog.getString('The wallet "{{walletName}}" was deleted', { notification.success(gettextCatalog.getString('Success'), gettextCatalog.getString('The wallet "{{walletName}}" was deleted', {
walletName: walletName walletName: walletName
})); }));

View file

@ -1,7 +1,7 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('preferencesHistory', angular.module('copayApp.controllers').controller('preferencesHistory',
function($scope, $log, $timeout, storageService, go, profileService, lodash) { function($scope, $log, $timeout, storageService, $state, profileService, lodash) {
var fc = profileService.focusedClient; var fc = profileService.focusedClient;
var c = fc.credentials; var c = fc.credentials;
$scope.csvReady = false; $scope.csvReady = false;
@ -125,7 +125,7 @@ angular.module('copayApp.controllers').controller('preferencesHistory',
$scope.$emit('Local/ClearHistory'); $scope.$emit('Local/ClearHistory');
$timeout(function() { $timeout(function() {
go.walletHome(); $state.go('tabs.home');
}, 100); }, 100);
}); });
}; };

View file

@ -1,7 +1,7 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('preferencesInformation', angular.module('copayApp.controllers').controller('preferencesInformation',
function($scope, $log, $timeout, platformInfo, gettextCatalog, lodash, profileService, configService, go, $stateParams) { function($scope, $log, $timeout, platformInfo, gettextCatalog, lodash, profileService, configService, $stateParams, walletService, $state) {
var base = 'xpub'; var base = 'xpub';
var wallet = profileService.getWallet($stateParams.walletId); var wallet = profileService.getWallet($stateParams.walletId);
var walletId = wallet.id; var walletId = wallet.id;
@ -104,7 +104,7 @@ angular.module('copayApp.controllers').controller('preferencesInformation',
opts.colorFor[walletId] = color; opts.colorFor[walletId] = color;
configService.set(opts, function(err) { configService.set(opts, function(err) {
go.walletHome(); $state.go('tabs.home');
if (err) $log.warn(err); if (err) $log.warn(err);
$scope.$emit('Local/ColorUpdated'); $scope.$emit('Local/ColorUpdated');
}); });
@ -121,4 +121,11 @@ angular.module('copayApp.controllers').controller('preferencesInformation',
} }
}; };
$scope.scan = function() {
walletService.startScan(wallet);
$state.go('tabs.home');
};
}); });

View file

@ -578,7 +578,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
} }
}); });
}) })
.run(function($rootScope, $state, $location, $log, $timeout, $ionicPlatform, lodash, platformInfo, profileService, uxLanguage, go, gettextCatalog) { .run(function($rootScope, $state, $location, $log, $timeout, $ionicPlatform, lodash, platformInfo, profileService, uxLanguage, gettextCatalog) {
if (platformInfo.isCordova) { if (platformInfo.isCordova) {
if (screen.width < 768) { if (screen.width < 768) {
@ -664,11 +664,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
else else
secondBackButtonPress = true; secondBackButtonPress = true;
$timeout(function() { $state.go('tabs.home');
$rootScope.$emit('Local/SetTab', 'walletHome', true);
}, 100);
go.walletHome();
}); });
$ionicPlatform.on('menubutton', function() { $ionicPlatform.on('menubutton', function() {

View file

@ -1,6 +1,6 @@
'use strict'; 'use strict';
angular.module('copayApp.services') angular.module('copayApp.services')
.factory('applicationService', function($rootScope, $timeout, platformInfo, go) { .factory('applicationService', function($rootScope, $timeout, platformInfo, $state) {
var root = {}; var root = {};
var isChromeApp = platformInfo.isChromeApp; var isChromeApp = platformInfo.isChromeApp;
@ -19,7 +19,7 @@ angular.module('copayApp.services')
if (isChromeApp) { if (isChromeApp) {
chrome.runtime.reload(); chrome.runtime.reload();
} else if (isNW) { } else if (isNW) {
go.walletHome(); $state.go('tabs.home');
$timeout(function() { $timeout(function() {
var win = require('nw.gui').Window.get(); var win = require('nw.gui').Window.get();
win.reload(3); win.reload(3);

View file

@ -1,10 +1,6 @@
'use strict'; 'use strict';
// DO NOT INCLUDE STORAGE HERE \/ \/ 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) {
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) {
// DO NOT INCLUDE STORAGE HERE ^^
//
//
// `wallet` is a decorated version of client. // `wallet` is a decorated version of client.
var root = {}; var root = {};
@ -104,7 +100,7 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
console.log('[walletService.js.93] TODO NOT AUTH'); //TODO console.log('[walletService.js.93] TODO NOT AUTH'); //TODO
// TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO // TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO
wallet.notAuthorized = true; wallet.notAuthorized = true;
go.walletHome(); $state.go('tabs.home');
} else if (err instanceof errors.NOT_FOUND) { } else if (err instanceof errors.NOT_FOUND) {
root.showErrorPopup(gettext('Could not access Wallet Service: Not found')); root.showErrorPopup(gettext('Could not access Wallet Service: Not found'));
} else { } else {
@ -665,6 +661,7 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
alertPopup.then(cb); alertPopup.then(cb);
}; };
// walletHome
root.recreate = function(wallet, cb) { root.recreate = function(wallet, cb) {
ongoingProcess.set('recreating', true); ongoingProcess.set('recreating', true);
wallet.recreateWallet(function(err) { wallet.recreateWallet(function(err) {
@ -672,7 +669,7 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
ongoingProcess.set('recreating', false); ongoingProcess.set('recreating', false);
if (err) { if (err) {
wallet.handleError(err); handleError(err);
return; return;
} }
@ -693,12 +690,10 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
includeCopayerBranches: true, includeCopayerBranches: true,
}, function(err) { }, function(err) {
// TODO if (err && wallet.walletId == walletId) {
// if (err && wallet.walletId == walletId) { wallet.updating = false;
// wallet.updating = false; handleError(err);
// wallet.handleError(err); }
// $rootScope.$apply();
// }
}); });
}; };