mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Content server: Workaround for Safari regression causing bookmarks to disappear on reload. Fixes #2006726 [calibre web view - missing bookmarks](https://bugs.launchpad.net/calibre/+bug/2006726)
This commit is contained in:
parent
006697d24f
commit
c3b7029667
@ -172,10 +172,12 @@ class DB:
|
|||||||
transaction = self.idb.transaction(stores)
|
transaction = self.idb.transaction(stores)
|
||||||
req = transaction.objectStore(store).get(data)
|
req = transaction.objectStore(store).get(data)
|
||||||
req.onsuccess = def(event):
|
req.onsuccess = def(event):
|
||||||
|
if proceed:
|
||||||
proceed(req.result)
|
proceed(req.result)
|
||||||
elif op is 'put':
|
elif op is 'put':
|
||||||
transaction = self.idb.transaction(stores, 'readwrite')
|
transaction = self.idb.transaction(stores, 'readwrite')
|
||||||
req = transaction.objectStore(store).put(data)
|
req = transaction.objectStore(store).put(data)
|
||||||
|
if proceed:
|
||||||
req.onsuccess = proceed
|
req.onsuccess = proceed
|
||||||
req.onerror = def(event):
|
req.onerror = def(event):
|
||||||
self.display_error(error_msg, event)
|
self.display_error(error_msg, event)
|
||||||
@ -327,7 +329,7 @@ class DB:
|
|||||||
changed = True
|
changed = True
|
||||||
book.annotations_map[unkey] = merged
|
book.annotations_map[unkey] = merged
|
||||||
if changed:
|
if changed:
|
||||||
self.do_op(['books'], book, _('Failed to write to the books database'), op='put')
|
self.do_op(['books'], book, _('Failed to write to the books database'), def(): None;, op='put')
|
||||||
)
|
)
|
||||||
|
|
||||||
def get_file(self, book, name, proceed):
|
def get_file(self, book, name, proceed):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user