summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Zorko <robertz@gurucue.com>2015-10-14 12:13:50 +0200
committerRobert Zorko <robertz@gurucue.com>2015-10-14 12:13:50 +0200
commit7a98e5ed234e5a7a0dc2a8e04b1ebccf7ea2fb29 (patch)
tree64387759a5bc5142e558b3bf0cd1d23f43a6ac13
parent9f5bcf0217be9400b2ee012577c4d5a44a44c3cc (diff)
fixed the logout bug when the user logs out while in the problem screen - the transition to the login screen must be performed before the logout happens
-rw-r--r--js/codeq/navigation.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/js/codeq/navigation.js b/js/codeq/navigation.js
index 57b398d..dab907a 100644
--- a/js/codeq/navigation.js
+++ b/js/codeq/navigation.js
@@ -61,7 +61,7 @@
}
},
'destroy': function () {
- if (currState !== null) currState.exit();
+ if (currState) currState.exit();
currState = null;
History.Adapter.unbind(window, 'statechange', stateChangeFun);
},
@@ -108,11 +108,12 @@
e.preventDefault();
});
$('#navigation-logout').on('click', function(e){
+ codeq.globalStateMachine.transition('login');
+
codeq.comms.logout()
.then(function (data) {
console.log(data);
codeq.comms.disconnect();
- codeq.globalStateMachine.transition('login');
})
.fail(function (reason) {
console.log(reason);