summaryrefslogtreecommitdiff
path: root/js/codeq/core.js
diff options
context:
space:
mode:
authorAleš Smodiš <aless@guru.si>2015-10-08 19:01:10 +0200
committerAleš Smodiš <aless@guru.si>2015-10-08 19:01:10 +0200
commit084e0806bc5aff00fc697cb51dee7b4a331e4b64 (patch)
treeb1df59c0ac4e8b2a13eb59a14d50f14137c324e0 /js/codeq/core.js
parent70b73f8e36900ab5b0784684fccc4069af1bae96 (diff)
Adapted to the reworked session handling on the server. Bugfixed the lang setting handling.
Diffstat (limited to 'js/codeq/core.js')
-rw-r--r--js/codeq/core.js17
1 files changed, 17 insertions, 0 deletions
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();
}
};
})();