From 084e0806bc5aff00fc697cb51dee7b4a331e4b64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Smodi=C5=A1?= Date: Thu, 8 Oct 2015 19:01:10 +0200 Subject: Adapted to the reworked session handling on the server. Bugfixed the lang setting handling. --- js/codeq/core.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'js/codeq/core.js') diff --git a/js/codeq/core.js b/js/codeq/core.js index 02bc2f0..d60c7e4 100644 --- a/js/codeq/core.js +++ b/js/codeq/core.js @@ -569,6 +569,23 @@ if (listeners[i] === callback) listeners.splice(i, 1); } } + }, + + // reset the app + 'reset': function (reason) { + codeq.log.info('App reset: ' + (reason || 'no reason given')); + codeq.globalStateMachine.transition('login'); + codeq.wait( + codeq.comms.logout() + .finally(codeq.comms.disconnect) + .fail(function () {}) // ignore errors + ) + .then(function () { + if (reason) { + alert(reason); + } + }) + .done(); } }; })(); -- cgit v1.2.1