From 466e357975a73a02ee1ed0d09935f930d8adebfc Mon Sep 17 00:00:00 2001 From: Victor239 <12621257+Victor239@users.noreply.github.com> Date: Sun, 22 Mar 2026 12:13:37 +0000 Subject: [PATCH] E-book viewer: skip storage.persist() if persistence already granted Check navigator.storage.persisted() before calling persist(), so tabs opened after permission was already granted do not trigger a redundant browser prompt. --- src/pyj/read_book/db.pyj | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pyj/read_book/db.pyj b/src/pyj/read_book/db.pyj index f13c0a13c0..1196f5a119 100644 --- a/src/pyj/read_book/db.pyj +++ b/src/pyj/read_book/db.pyj @@ -156,7 +156,10 @@ class DB: self.show_error(_('Database upgraded!'), _( 'A newer version of calibre is available, please click the Reload button in your browser.')) if window.navigator.storage?.persist: - window.navigator.storage.persist() + window.navigator.storage.persisted().then(def(already_persistent): + if not already_persistent: + window.navigator.storage.persist() + ) self.callback() def display_error(self, msg, event):