summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);