mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Ignore swapCache failures
This commit is contained in:
parent
1672ef4f22
commit
8ee6f735d2
@ -18,9 +18,14 @@ if is_running_in_iframe:
|
||||
else:
|
||||
window.applicationCache.addEventListener('updateready', def():
|
||||
if window.applicationCache.status is window.applicationCache.UPDATEREADY:
|
||||
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…
x
Reference in New Issue
Block a user