diff --git a/index.html b/index.html index d3a91b4..26cc8be 100644 --- a/index.html +++ b/index.html @@ -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); }, );