Commit 6f4e8f40 authored by Jérome Perrin's avatar Jérome Perrin

GUI: only warn about errors while we are updating manifest

parent e3f41bb4
......@@ -15,7 +15,11 @@
// Prompt user to reload after manifest update.
// from http://www.html5rocks.com/en/tutorials/appcache/beginner/#toc-updating-cache
window.addEventListener('load', function() {
var updating = false;
if (window.applicationCache) {
window.applicationCache.addEventListener('downloading', function() {
updating = true;
}, false);
window.applicationCache.addEventListener('updateready', function() {
if (window.applicationCache.status === window.applicationCache.UPDATEREADY) {
// Browser downloaded a new app cache.
......@@ -27,7 +31,11 @@
}
}, false);
window.applicationCache.addEventListener('error', function() {
alert("Fatal error while updating, retrying"); window.location.reload();}, false );
if (updating){
alert("Fatal error while updating, retrying");
window.location.reload();
}
}, false );
}
}, false);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment