From ccdc0de9f205109d24de642d96345e5d435170cc Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Wed, 11 Jun 2025 15:09:47 +0200 Subject: [PATCH] feat: Make it possible to save the character roster to localStorage --- index.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/index.html b/index.html index a5b2aed..5acf19c 100644 --- a/index.html +++ b/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(