Show the message about clearing the cache in the right place

This commit is contained in:
Kovid Goyal 2017-06-27 00:51:04 +05:30
parent f0545dacb9
commit aae905d843
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -294,13 +294,15 @@ class DB:
key = file_store_name(book, name)
err = _(
'Failed to read the file {0} for the book {1} from the browser offline cache.'
' This usually means the cache is close to full. Clear the browser'
' cache from the browser settings.').format(name, book.metadata.title)
).format(name, book.metadata.title)
self.do_op(['files'], key, err, def (result):
if not result:
# File was not found in the cache, this happens in Chrome if
# the Application Cache is full. IndexedDB put succeeds,
# but get fails. Browsers are a horrible travesty.
err += _(
' This usually means the cache is close to full. Clear the browser'
' cache from the browser settings.')
self.show_error(_('Cannot read file from book'), err)
return
fdata = book.stored_files[key]
@ -313,9 +315,7 @@ class DB:
def get_mathjax_files(self, proceed):
c = self.idb.transaction('mathjax').objectStore('mathjax').openCursor()
c.onerror = def(event):
err = _('Failed to read the MathJax files from local storage.'
' This usually means the cache is close to full. Clear the browser'
' cache from the browser settings.')
err = _('Failed to read the MathJax files from the browser offline cache.')
self.display_error(err, event)
data = {}
c.onsuccess = def(event):