diff --git a/config.js b/config.js index 44ebba7..0549cc6 100644 --- a/config.js +++ b/config.js @@ -193,8 +193,18 @@ function loadSheet(name) { } function storeRoster(roster) { - if (storage) - storage.setItem("roster", JSON.stringify(roster)); + if (storage) { + try { + storage.setItem("roster", JSON.stringify(roster)); + return true; + } catch (err) { + if (err.toString().indexOf("QUOTA_EXCEEDED_ERR") != -1) { + alert("The limited storage available on this device has been filled. This game can lo longer be saved.") + storage = null;; + return false; + } + } + } } function addToRoster(newguy) { diff --git a/main.js b/main.js index 5b99585..4aa92b9 100644 --- a/main.js +++ b/main.js @@ -5,6 +5,7 @@ // TODO: Hide cheaters // After launch +// TODO: Stop using HTML to save the game // TODO: Get fully operational in Opera // TODO: Online leader board // TODO: Server side saves