Warn when ipad save fails

This commit is contained in:
Eric Fredricksen
2010-07-09 15:07:05 -07:00
parent b1317083fd
commit cd7f62fd7d
2 changed files with 13 additions and 2 deletions
+12 -2
View File
@@ -193,8 +193,18 @@ function loadSheet(name) {
} }
function storeRoster(roster) { function storeRoster(roster) {
if (storage) if (storage) {
storage.setItem("roster", JSON.stringify(roster)); 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) { function addToRoster(newguy) {
+1
View File
@@ -5,6 +5,7 @@
// TODO: Hide cheaters // TODO: Hide cheaters
// After launch // After launch
// TODO: Stop using HTML to save the game
// TODO: Get fully operational in Opera // TODO: Get fully operational in Opera
// TODO: Online leader board // TODO: Online leader board
// TODO: Server side saves // TODO: Server side saves