diff --git a/src/pyj/read_book/db.pyj b/src/pyj/read_book/db.pyj index e0b39daa2d..dc4d3b0059 100644 --- a/src/pyj/read_book/db.pyj +++ b/src/pyj/read_book/db.pyj @@ -155,6 +155,9 @@ class DB: req.onerror = def(event): proceed(_('Failed to store book data ({0}) with error: {1}').format(name, get_error_details(event))) + def clear_mathjax(self, proceed): + self.idb.transaction(['mathjax'], 'readwrite').objectStore('mathjax').clear().onsuccess = proceed + def store_mathjax_file(self, name, xhr, proceed): data = xhr.response if not self.supports_blobs: diff --git a/src/pyj/read_book/ui.pyj b/src/pyj/read_book/ui.pyj index 8d8ec5f3a9..b21b26f12a 100644 --- a/src/pyj/read_book/ui.pyj +++ b/src/pyj/read_book/ui.pyj @@ -261,7 +261,9 @@ class ReadUI: if mathjax_info.version is MATHJAX_VERSION: return proceed() print('Upgrading MathJax, previous version:', mathjax_info.version) - self.get_mathjax_manifest(mathjax_info, proceed) + self.db.clear_mathjax(def(): + self.get_mathjax_manifest(mathjax_info, proceed) + ) ) def get_mathjax_manifest(self, mathjax_info, proceed):