Load character roster from localStorage upon startup

This commit is contained in:
Gergely Polonkai 2025-06-05 19:29:52 +02:00
parent 5c84c35b05
commit 241196186b
No known key found for this signature in database
GPG Key ID: 2D2885533B869ED4

View File

@ -433,6 +433,16 @@
input.disabled = !toUnlock;
};
const saveCharacterRoster = () => {
if (!checkLocalStorage()) {
alert("Local Storage is not available, cannot save roster.");
return;
}
localStorage.setItem("character-roster", JSON.stringify())
};
document.addEventListener(
"DOMContentLoaded",
() => {
@ -440,6 +450,10 @@
document.getElementById("no-local-storage").style.display = "initial";
alert("Local Storage is not available, saving and loading data will be unavailable.");
}
var newRoster = localStorage.getItem("character-roster");
characterRoster = (newRoster === null) ? {} : JSON.parse(newRoster);
},
);