diff --git a/index.html b/index.html index 5acf19c..0aca890 100644 --- a/index.html +++ b/index.html @@ -523,6 +523,17 @@ saveCharacterRoster(); }; + const loadCharacterRoster = (doLocalStorageCheck) => { + if (doLocalStorageCheck && !checkLocalStorage()) { + alert("Local Storage is not available, cannot load roster."); + + return; + } + + var newRoster = localStorage.getItem("character-roster"); + characterRoster = (newRoster === null) ? {} : JSON.parse(newRoster); + }; + document.addEventListener( "DOMContentLoaded", () => { @@ -539,6 +550,7 @@ btnSaveCharacter.addEventListener("click", saveCurrentCharacter); clearSheet(); + loadCharacterRoster(true); }, );