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) {
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) {