mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2025-01-13 06:29:57 +00:00
try to catch QuotaExceededError
This commit is contained in:
parent
53669cd579
commit
c3d792f82f
@ -148,7 +148,6 @@ TODO:
|
||||
- allow "include graphics.asm" instead of "include project/graphics.asm"
|
||||
- convert more stuff to Promises
|
||||
- target ES6
|
||||
- don't have to include bootstrap-tourist each time?
|
||||
- don't have to include firebase always?
|
||||
- squelch error msgs?
|
||||
- test offline? (if window.firebase)
|
||||
|
13
src/ui.ts
13
src/ui.ts
@ -108,11 +108,13 @@ function requestPersistPermission() {
|
||||
if (navigator.storage && navigator.storage.persist) {
|
||||
navigator.storage.persist().then(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 {
|
||||
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.");
|
||||
}
|
||||
}
|
||||
|
||||
@ -1683,7 +1685,12 @@ function installErrorHandler() {
|
||||
'exFatal': true
|
||||
});
|
||||
$.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();
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user