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 = () => {
|
const saveCurrentCharacter = () => {
|
||||||
characterRoster[currentCharacter] = sheetToObject();
|
characterRoster[currentCharacter] = sheetToObject();
|
||||||
|
|
||||||
|
saveCharacterRoster();
|
||||||
};
|
};
|
||||||
|
|
||||||
document.addEventListener(
|
document.addEventListener(
|
||||||
|
Reference in New Issue
Block a user