diff --git a/www/js/controllers/app-controllers.js b/www/js/controllers/app-controllers.js index 26323640c74a0dce72ceb3bf64769045fddbf024..9689b00bac568ae3bf811d1505d443aefa07a7bd 100644 --- a/www/js/controllers/app-controllers.js +++ b/www/js/controllers/app-controllers.js @@ -317,6 +317,14 @@ function AppController($scope, $rootScope, $state, $ionicSideMenuDelegate, $q, $ .catch(UIUtils.onError()); }; + // Login and go to a state (or wallet if not) + $scope.doAuth = function() { + return $scope.loadWallet({auth: true}) + .then(function() { + UIUtils.loading.hide(); + }); + }; + // If connected and same pubkey $scope.isUserPubkey = function(pubkey) { return csWallet.isUserPubkey(pubkey); diff --git a/www/plugins/es/templates/common/popover_profile_extend.html b/www/plugins/es/templates/common/popover_profile_extend.html index 730189522ed4b6111da742baf2142ef28c127202..33d61e3d561ccceb1b642ac1449af578b3165c6c 100644 --- a/www/plugins/es/templates/common/popover_profile_extend.html +++ b/www/plugins/es/templates/common/popover_profile_extend.html @@ -1,5 +1,5 @@ <!-- profile --> - <button ng-if="enable" + <button ng-if="enable && auth" class="button button-positive button-small ink" ng-click="showEditUserProfile()"> {{'PROFILE.BTN_EDIT' | translate}} diff --git a/www/templates/common/popover_profile.html b/www/templates/common/popover_profile.html index cb4db06ac0005bf8ffbb941566f59ba4424c97c0..f21b01bbe810eeb13fa2b843d33550ca3e1e167a 100644 --- a/www/templates/common/popover_profile.html +++ b/www/templates/common/popover_profile.html @@ -22,6 +22,13 @@ <div class="row" ng-show="login"> <div class="col col-66 col-offset-33"> + <!-- auth --> + <button ng-show="!auth" + class="button button-assertive button-small ink" + ng-click="doAuth()"> + {{'AUTH.BTN_AUTH' | translate}} + </button> + <!-- Allow extension here --> <cs-extension-point name="profile-popover-user"></cs-extension-point> </div>