feat: Make it possible to save the character roster to localStorage

This commit is contained in:
2025-06-11 15:09:47 +02:00
parent 0f39e94df5
commit ccdc0de9f2

View File

@@ -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(