From f5197fc6c01b28ba6d652aee4ce19d82d48d9cc5 Mon Sep 17 00:00:00 2001 From: Victor239 <12621257+Victor239@users.noreply.github.com> Date: Sun, 22 Mar 2026 11:12:14 +0000 Subject: [PATCH] Revert: remove resend on auth failure --- src/pyj/read_book/ui.pyj | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/pyj/read_book/ui.pyj b/src/pyj/read_book/ui.pyj index d32c05b245..c076f0835c 100644 --- a/src/pyj/read_book/ui.pyj +++ b/src/pyj/read_book/ui.pyj @@ -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