mirror of
https://github.com/kovidgoyal/calibre.git
synced 2026-04-03 07:41:58 -04:00
Revert: remove resend on auth failure
This commit is contained in:
parent
b3c2191022
commit
f5197fc6c0
@ -61,7 +61,6 @@ class ReadUI:
|
||||
self.unsynced_amap = None
|
||||
self.unsynced_indicator_active = False
|
||||
self.unsynced_indicator_timer = None
|
||||
self.annot_upload_auth_retry_timer = None
|
||||
window.addEventListener('resize', debounce(self.on_resize.bind(self), 250))
|
||||
window.addEventListener('online', self._on_network_restored.bind(self))
|
||||
window.addEventListener('message', self.message_from_other_window.bind(self))
|
||||
@ -319,9 +318,6 @@ class ReadUI:
|
||||
|
||||
def _annot_upload_done(self, end_type, xhr, ev):
|
||||
if end_type is 'load':
|
||||
if self.annot_upload_auth_retry_timer:
|
||||
window.clearTimeout(self.annot_upload_auth_retry_timer)
|
||||
self.annot_upload_auth_retry_timer = None
|
||||
self.unsynced_amap = None
|
||||
self.db.clear_pending_annot_upload()
|
||||
if self.unsynced_indicator_timer:
|
||||
@ -330,16 +326,6 @@ class ReadUI:
|
||||
if self.unsynced_indicator_active:
|
||||
self.unsynced_indicator_active = False
|
||||
self.view.show_unsynced_indicator(False)
|
||||
elif xhr and xhr.status is 401:
|
||||
if self.annot_upload_auth_retry_timer:
|
||||
window.clearTimeout(self.annot_upload_auth_retry_timer)
|
||||
def do_retry():
|
||||
self.annot_upload_auth_retry_timer = None
|
||||
if self.unsynced_amap is not None and self.base_url_data:
|
||||
ajax_send(
|
||||
f'book-update-annotations/{self.base_url_data.library_id}/{self.base_url_data.book_id}/{self.base_url_data.fmt}',
|
||||
self.unsynced_amap, self._annot_upload_done.bind(self))
|
||||
self.annot_upload_auth_retry_timer = window.setTimeout(do_retry, 5000)
|
||||
|
||||
def has_unsynced_changes(self):
|
||||
return self.unsynced_indicator_active
|
||||
@ -354,9 +340,6 @@ class ReadUI:
|
||||
|
||||
def upload_pending_annotations(self, callback):
|
||||
if self.unsynced_amap is not None:
|
||||
if self.annot_upload_auth_retry_timer:
|
||||
window.clearTimeout(self.annot_upload_auth_retry_timer)
|
||||
self.annot_upload_auth_retry_timer = None
|
||||
library_id = self.base_url_data.library_id
|
||||
book_id = self.base_url_data.book_id
|
||||
fmt = self.base_url_data.fmt
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user