From 74d6f76d8e21f21b029dc6838bb34c25ab9e0b68 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Wed, 3 Dec 2014 00:30:44 -0300 Subject: [PATCH] signout/lock text --- index.html | 1 - js/controllers/sidebar.js | 11 ++++++----- js/models/Identity.js | 10 +++++----- views/includes/sidebar-mobile.html | 7 +++++-- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/index.html b/index.html index 4a4911c6a..c49a154fb 100644 --- a/index.html +++ b/index.html @@ -34,7 +34,6 @@
 
 
- Logging Out diff --git a/js/controllers/sidebar.js b/js/controllers/sidebar.js index 6dadb4057..3485558fd 100644 --- a/js/controllers/sidebar.js +++ b/js/controllers/sidebar.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('SidebarController', function($scope, $rootScope, $location, $timeout, identityService) { +angular.module('copayApp.controllers').controller('SidebarController', function($scope, $rootScope, $location, $timeout, identityService, pinService) { $scope.menu = [{ 'title': 'Home', @@ -48,7 +48,7 @@ angular.module('copayApp.controllers').controller('SidebarController', function( $scope.init = function() { // This should be called only once. - + // focused wallet change if ($rootScope.wallet) { $rootScope.$watch('wallet', function() { @@ -73,16 +73,17 @@ angular.module('copayApp.controllers').controller('SidebarController', function( if (newWid && $rootScope.iden.getWalletById(newWid)) { identityService.setFocusedWallet(newWid); } else { - copay.logger.debug('No wallets'); + copay.logger.debug('No wallets'); identityService.noFocusedWallet(newWid); } } $scope.walletSelection = false; $scope.setWallets(); }); - + pinService.check(function(err, value) { + $scope.hasPin = value; + }); } - }; $scope.setWallets = function() { diff --git a/js/models/Identity.js b/js/models/Identity.js index 3799e329f..e215412fa 100644 --- a/js/models/Identity.js +++ b/js/models/Identity.js @@ -355,17 +355,17 @@ Identity.prototype.remove = function(opts, cb) { }; Identity.prototype._cleanUp = function() { - // NOP + _.each(this.wallets, function(w){ + w.close(); + }); }; /** * @desc Closes the wallet and disconnects all services */ Identity.prototype.close = function() { - var self = this; - self.store({}, function(err) { - self.emitAndKeepAlive('closed'); - }); + this._cleanUp(); + this.emitAndKeepAlive('closed'); }; diff --git a/views/includes/sidebar-mobile.html b/views/includes/sidebar-mobile.html index 2a89ab52c..fcc61cf56 100644 --- a/views/includes/sidebar-mobile.html +++ b/views/includes/sidebar-mobile.html @@ -1,4 +1,4 @@ -
+
@@ -101,7 +101,10 @@
  • {{'Close'|translate}} + ng-click="signout()"> + {{'Close'|translate}} + {{'Lock'|translate}} +