rewrite2 add logout

This commit is contained in:
Tyler Renelle 2013-08-25 21:27:47 -04:00
parent d47e703434
commit a172214bf1
3 changed files with 7 additions and 4 deletions

View file

@ -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

View file

@ -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

View file

@ -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