mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-05 03:52:14 +00:00
rewrite2 add logout
This commit is contained in:
parent
d47e703434
commit
a172214bf1
3 changed files with 7 additions and 4 deletions
|
|
@ -11,6 +11,10 @@ habitrpg.controller "AuthCtrl", ($scope, $rootScope, Facebook, LocalAuth, User,
|
|||
showedFacebookMessage = true
|
||||
$scope.useUUID = not $scope.useUUID
|
||||
|
||||
$scope.logout = ->
|
||||
localStorage.clear()
|
||||
location.reload()
|
||||
|
||||
$scope.register = ->
|
||||
#TODO highlight invalid inputs
|
||||
# we have this as a workaround for https://github.com/HabitRPG/habitrpg-mobile/issues/64
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
"use strict"
|
||||
habitrpg.controller "TasksCtrl", ($scope, $rootScope, $location, filterFilter, User, Algos, Helpers, Notification) ->
|
||||
habitrpg.controller "TasksCtrl", ($scope, $rootScope, $location, User, Algos, Helpers, Notification) ->
|
||||
|
||||
#FIXME
|
||||
$scope.taskLists = [
|
||||
|
|
@ -21,7 +21,6 @@ habitrpg.controller "TasksCtrl", ($scope, $rootScope, $location, filterFilter, U
|
|||
newValue = User.user.stats[key]
|
||||
statsDiff[key] = newValue - value if newValue isnt value
|
||||
|
||||
|
||||
#notify user if there are changes in stats.
|
||||
if Object.keys(statsDiff).length > 0
|
||||
Notification.push
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.user-menu
|
||||
.user-menu(ng-controller='AuthCtrl')
|
||||
button.task-action-btn.tile.solid(ng-hide='authenticated()', style='cursor: pointer;', ng-click="modals.login = true") Login / Register
|
||||
ul.nav.site-nav(ng-show='authenticated()')
|
||||
li.flyout
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
span(ng-show='_gamePane') Tasks
|
||||
span(ng-hide='_gamePane') Options
|
||||
li
|
||||
a.task-action-btn.tile.solid(href='/logout') Logout
|
||||
a.task-action-btn.tile.solid(ng-click='logout()') Logout
|
||||
// party invitation notification
|
||||
a(ng-show='user.party.invitation', style='cursor: pointer;', x-bind='click:gotoPartyChat')
|
||||
i.icon-user
|
||||
|
|
|
|||
Loading…
Reference in a new issue