signout/lock text
This commit is contained in:
parent
583b8314ec
commit
74d6f76d8e
4 changed files with 16 additions and 13 deletions
|
|
@ -34,7 +34,6 @@
|
||||||
<div class="contener_mixte"><div class="ballcolor ball_3"> </div></div>
|
<div class="contener_mixte"><div class="ballcolor ball_3"> </div></div>
|
||||||
<div class="contener_mixte"><div class="ballcolor ball_4"> </div></div>
|
<div class="contener_mixte"><div class="ballcolor ball_4"> </div></div>
|
||||||
</div>
|
</div>
|
||||||
<span class="text-gray size-12" translate>Logging Out</span>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'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 = [{
|
$scope.menu = [{
|
||||||
'title': 'Home',
|
'title': 'Home',
|
||||||
|
|
@ -48,7 +48,7 @@ angular.module('copayApp.controllers').controller('SidebarController', function(
|
||||||
|
|
||||||
$scope.init = function() {
|
$scope.init = function() {
|
||||||
// This should be called only once.
|
// This should be called only once.
|
||||||
|
|
||||||
// focused wallet change
|
// focused wallet change
|
||||||
if ($rootScope.wallet) {
|
if ($rootScope.wallet) {
|
||||||
$rootScope.$watch('wallet', function() {
|
$rootScope.$watch('wallet', function() {
|
||||||
|
|
@ -73,16 +73,17 @@ angular.module('copayApp.controllers').controller('SidebarController', function(
|
||||||
if (newWid && $rootScope.iden.getWalletById(newWid)) {
|
if (newWid && $rootScope.iden.getWalletById(newWid)) {
|
||||||
identityService.setFocusedWallet(newWid);
|
identityService.setFocusedWallet(newWid);
|
||||||
} else {
|
} else {
|
||||||
copay.logger.debug('No wallets');
|
copay.logger.debug('No wallets');
|
||||||
identityService.noFocusedWallet(newWid);
|
identityService.noFocusedWallet(newWid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$scope.walletSelection = false;
|
$scope.walletSelection = false;
|
||||||
$scope.setWallets();
|
$scope.setWallets();
|
||||||
});
|
});
|
||||||
|
pinService.check(function(err, value) {
|
||||||
|
$scope.hasPin = value;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.setWallets = function() {
|
$scope.setWallets = function() {
|
||||||
|
|
|
||||||
|
|
@ -355,17 +355,17 @@ Identity.prototype.remove = function(opts, cb) {
|
||||||
};
|
};
|
||||||
|
|
||||||
Identity.prototype._cleanUp = function() {
|
Identity.prototype._cleanUp = function() {
|
||||||
// NOP
|
_.each(this.wallets, function(w){
|
||||||
|
w.close();
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @desc Closes the wallet and disconnects all services
|
* @desc Closes the wallet and disconnects all services
|
||||||
*/
|
*/
|
||||||
Identity.prototype.close = function() {
|
Identity.prototype.close = function() {
|
||||||
var self = this;
|
this._cleanUp();
|
||||||
self.store({}, function(err) {
|
this.emitAndKeepAlive('closed');
|
||||||
self.emitAndKeepAlive('closed');
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<div ng-controller="SidebarController" ng-init="getWallets()">
|
<div ng-controller="SidebarController" ng-init="init()">
|
||||||
<header>
|
<header>
|
||||||
<div ng-click="toggleWalletSelection()">
|
<div ng-click="toggleWalletSelection()">
|
||||||
<div class="col1">
|
<div class="col1">
|
||||||
|
|
@ -101,7 +101,10 @@
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="#!/" class="db p20h nav-item" title="Close"
|
<a href="#!/" class="db p20h nav-item" title="Close"
|
||||||
ng-click="signout()"><i class="size-24 m20r fi-power"></i> {{'Close'|translate}}</a>
|
ng-click="signout()">
|
||||||
|
<span ng-if="!hasPin"><i class="size-24 m20r fi-power"></i> {{'Close'|translate}}</span>
|
||||||
|
<span ng-if="hasPin"><i class="size-24 m20r fi-lock"></i> {{'Lock'|translate}}</span>
|
||||||
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="text-gray size-12 text-center columns">
|
<div class="text-gray size-12 text-center columns">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue