Fix: loadMaestroID, saveMaestroID
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
let maestroID = -1;
|
||||
|
||||
$(document).ready(function() {
|
||||
loadMaestroID();
|
||||
});
|
||||
|
||||
|
||||
function loadMaestroID() {
|
||||
maestroID = sessionStorage.getItem("maestroID");
|
||||
if(maestroID === null) {
|
||||
maestroID = -1;
|
||||
sessionStorage.setItem("maestroID", maestroID);
|
||||
}
|
||||
maestroID = Number(maestroID);
|
||||
console.log("loaded maestroID : " + maestroID);
|
||||
}
|
||||
|
||||
function saveMaestroID() {
|
||||
sessionStorage.setItem("maestroID", maestroID);
|
||||
console.log("saved maestroID : " + maestroID);
|
||||
}
|
||||
|
||||
function goHome() {
|
||||
if(maestroID === -1) {
|
||||
location.href = "./../main/index.html";
|
||||
} else {
|
||||
location.href = "./../maestro/main_menu.html";
|
||||
}
|
||||
}
|
||||
|
||||
function logout() {
|
||||
sessionStorage.clear();
|
||||
maestroID = -1;
|
||||
sessionStorage.setItem("maestroID", maestroID);
|
||||
location.href = './../main/index.html';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user