mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 22:14:07 +02:00
Ignore swapCache failures
This commit is contained in:
parent
1672ef4f22
commit
8ee6f735d2
1 changed files with 8 additions and 3 deletions
|
|
@ -18,9 +18,14 @@
|
|||
else:
|
||||
window.applicationCache.addEventListener('updateready', def():
|
||||
if window.applicationCache.status is window.applicationCache.UPDATEREADY:
|
||||
window.applicationCache.swapCache()
|
||||
if window.confirm(_('The calibre web application has been updated. Do you want reload the site?')):
|
||||
window.location.reload()
|
||||
try:
|
||||
window.applicationCache.swapCache()
|
||||
if window.confirm(_('The calibre web application has been updated. Do you want reload the site?')):
|
||||
window.location.reload()
|
||||
except Exception as e:
|
||||
# For some reason swapCache occassionally fails even though status is UPDATEREADY
|
||||
print('WARNING: falied to swap applicationCache')
|
||||
console.log(e)
|
||||
, False)
|
||||
script = document.currentScript or document.scripts[0]
|
||||
main_js(script.textContent)
|
||||
|
|
|
|||
Loading…
Reference in a new issue