mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2024-06-03 04:29:33 +00:00
try to catch QuotaExceededError
This commit is contained in:
parent
5a618dbd2f
commit
894ac96be3
|
@ -148,7 +148,6 @@ TODO:
|
||||||
- allow "include graphics.asm" instead of "include project/graphics.asm"
|
- allow "include graphics.asm" instead of "include project/graphics.asm"
|
||||||
- convert more stuff to Promises
|
- convert more stuff to Promises
|
||||||
- target ES6
|
- target ES6
|
||||||
- don't have to include bootstrap-tourist each time?
|
|
||||||
- don't have to include firebase always?
|
- don't have to include firebase always?
|
||||||
- squelch error msgs?
|
- squelch error msgs?
|
||||||
- test offline? (if window.firebase)
|
- test offline? (if window.firebase)
|
||||||
|
|
13
src/ui.ts
13
src/ui.ts
|
@ -118,11 +118,13 @@ function requestPersistPermission() {
|
||||||
if (navigator.storage && navigator.storage.persist) {
|
if (navigator.storage && navigator.storage.persist) {
|
||||||
navigator.storage.persist().then(persistent=>{
|
navigator.storage.persist().then(persistent=>{
|
||||||
if (persistent) {
|
if (persistent) {
|
||||||
alertInfo("We asked your browser to persist local data, and it said yes.");
|
alertInfo("Your browser says you have unlimited persistent storage quota for this site. If you got an error while storing something, please try again.");
|
||||||
} else {
|
} else {
|
||||||
alertInfo("This browser may not persist local data. Are you in a private window?");
|
alertInfo("Your browser says your local files may not be persisted. Are you in a private window?");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
alertInfo("Your browser doesn't support expanding the persistent storage quota.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1709,7 +1711,12 @@ function installErrorHandler() {
|
||||||
'exFatal': true
|
'exFatal': true
|
||||||
});
|
});
|
||||||
$.get("/error?msg=" + encodeURIComponent(msg), "text");
|
$.get("/error?msg=" + encodeURIComponent(msg), "text");
|
||||||
alertError(msg);
|
// storage quota full? (Chrome) try to expand it
|
||||||
|
if (msg.indexOf("QuotaExceededError") >= 0) {
|
||||||
|
requestPersistPermission();
|
||||||
|
} else {
|
||||||
|
alertError(msg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
_pause();
|
_pause();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user