mirror of
https://github.com/simon987/Much-Assembly-Required-Frontend.git
synced 2025-04-19 18:46:41 +00:00
implements #20
with #fd2ef569b36f98c00ee7e9953f0041d6dff30316 fixes #20
This commit is contained in:
parent
fd2ef569b3
commit
dae48c0ded
@ -803,17 +803,17 @@ function codeListener(message) {
|
||||
* Listens for authentications responses from the server
|
||||
*/
|
||||
function authListener(message) {
|
||||
|
||||
if (message.t === "auth") {
|
||||
|
||||
if (message.m === "ok") {
|
||||
console.log("Auth successful");
|
||||
mar.client.requestUserInfo();
|
||||
|
||||
} else {
|
||||
alert("Authentication failed. Please make sure you are logged in and reload the page.");
|
||||
if (message.t === "code") {
|
||||
var code = message.code;
|
||||
if(typeof window.localStorage !== 'undefined') { // localStorage is supported
|
||||
var value = window.localStorage.getItem("editorCodeContents");
|
||||
// if item does not exist null is returned
|
||||
if(value !== null) {
|
||||
code = value;
|
||||
}
|
||||
}
|
||||
ace.edit("editor").setValue(code);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user