feat: Make it possible to save the character roster to localStorage
This commit is contained in:
12
index.html
12
index.html
@@ -507,8 +507,20 @@
|
||||
};
|
||||
};
|
||||
|
||||
const saveCharacterRoster = () => {
|
||||
if (!checkLocalStorage()) {
|
||||
alert("Local Storage is not available, cannot save roster.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
localStorage.setItem("character-roster", JSON.stringify(characterRoster));
|
||||
};
|
||||
|
||||
const saveCurrentCharacter = () => {
|
||||
characterRoster[currentCharacter] = sheetToObject();
|
||||
|
||||
saveCharacterRoster();
|
||||
};
|
||||
|
||||
document.addEventListener(
|
||||
|
Reference in New Issue
Block a user