mirror of
https://github.com/simon987/Much-Assembly-Required-Frontend.git
synced 2025-04-20 10:56:44 +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
|
* Listens for authentications responses from the server
|
||||||
*/
|
*/
|
||||||
function authListener(message) {
|
function authListener(message) {
|
||||||
|
if (message.t === "code") {
|
||||||
if (message.t === "auth") {
|
var code = message.code;
|
||||||
|
if(typeof window.localStorage !== 'undefined') { // localStorage is supported
|
||||||
if (message.m === "ok") {
|
var value = window.localStorage.getItem("editorCodeContents");
|
||||||
console.log("Auth successful");
|
// if item does not exist null is returned
|
||||||
mar.client.requestUserInfo();
|
if(value !== null) {
|
||||||
|
code = value;
|
||||||
} else {
|
|
||||||
alert("Authentication failed. Please make sure you are logged in and reload the page.");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ace.edit("editor").setValue(code);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user