This commit is contained in:
Matias Alejo Garcia 2014-12-06 15:30:32 -03:00
commit de54f3aac8
6 changed files with 13 additions and 32 deletions

View file

@ -62,7 +62,7 @@
<section class="left-small">
<a class="left-off-canvas-toggle menu-icon" ><span></span></a>
</section>
<section class="right-small">
<section class="right-small" ng-if="$root.iden && $root.iden.listWallets().length >1">
<a class="right-off-canvas-toggle p10"><i class="icon-wallet size-24"></i></a>
</section>
@ -77,7 +77,7 @@
<div ng-include="'views/includes/sidebar-mobile.html'"></div>
</aside>
<aside class="right-off-canvas-menu">
<aside class="right-off-canvas-menu" ng-if="$root.iden && $root.iden.listWallets().length >1">
<div ng-include="'views/includes/walletbar-mobile.html'"></div>
</aside>
<div

View file

@ -56,21 +56,6 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc
}
});
$scope.done = function() {
$rootScope.starting = false;
$rootScope.$digest();
};
$scope.$on("$destroy", function() {
var iden = $rootScope.iden;
if (iden) {
iden.removeListener('newWallet', $scope.done);
iden.removeListener('noWallets', $scope.done);
}
});
$scope.openWithPin = function(pin) {
if (!pin) {
@ -92,11 +77,8 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc
$scope.openWallets = function() {
preconditions.checkState($rootScope.iden);
var iden = $rootScope.iden;
$rootScope.hideNavigation = false;
$rootScope.starting = true;
iden.on('newWallet', $scope.done);
iden.on('noWallets', $scope.done);
iden.openWallets();
};
@ -169,7 +151,6 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc
// mobile
if ($scope.isMobile && !$rootScope.hasPin) {
$scope.done();
_credentials = {
email: email,
password: password,

View file

@ -68,7 +68,7 @@ angular.module('copayApp.controllers').controller('HomeWalletController', functi
removeWatch();
w.removeListener('txProposalEvent', _updateTxs);
};
});
});
$scope.setAlternativeAmount = function(w, tx, cb) {
rateService.whenAvailable(function() {

View file

@ -31,6 +31,7 @@ angular.module('copayApp.services')
root.goWalletHome = function() {
var w = $rootScope.wallet;
if (w) {
$rootScope.starting = false;
if (!w.isComplete()) {
$location.path('/copayers');
} else {
@ -233,7 +234,7 @@ angular.module('copayApp.services')
w.on('txProposalEvent', function(e) {
if (root.isFocused(wid)) {
pendingTxsService.update();
pendingTxsService.update();
}
balanceService.update(w, function() {
@ -288,7 +289,6 @@ angular.module('copayApp.services')
var self = this;
root.setupGlobalVariables(iden);
iden.on('newWallet', function(wid) {
var w = iden.getWalletById(wid);
copay.logger.debug('newWallet:', w.getName(), wid, iden.getLastFocusedWalletId());
@ -298,20 +298,25 @@ angular.module('copayApp.services')
root.setFocusedWallet(w, true);
root.goWalletHome();
}
// At the end (after all handlers are in place)...start the wallet.
w.netStart();
});
iden.on('noWallets', function() {
notification.warning('No Wallets','Your profile has no wallet. Create one here');
$rootScope.starting = false;
$location.path('/create');
$rootScope.$digest()
$timeout(function() {
$rootScope.$digest();
}, 1);
});
iden.on('walletDeleted', function(wid) {
// do nothing. this is handled 'on sync' on controller.
});
iden.on('walletStorageError', function (wid, message) {
iden.on('walletStorageError', function(wid, message) {
notification.error('Error storing wallet', message);
});

View file

@ -111,7 +111,7 @@
</form>
</div>
<div ng-if='!$root.hasPin && !askForPin'>
<div ng-if='!$root.hasPin && !askForPin && !$root.iden'>
<div class="clipo">
<img src="img/clipo-signin.png" alt="clipo" width="310">
</div>

View file

@ -2,11 +2,6 @@
<header ng-show="$root.wallet">
<h1>My wallets</h1>
</header>
<div class="side-nav text-center off-canvas-list" ng-show="!wallets[0]">
<p class="size-12 text-gray m10t" translate>You do not have another wallets.</p>
<a href="#!/create" class="db button secondary tiny" title="Create new wallet">
<i class="m10r fi-plus"></i> {{'Create new wallet' | translate }} </a>
</div>
<ul class="side-nav wallets off-canvas-list" ng-show="wallets[0]">
<li
ng-repeat="item in wallets track by $index"