Guard push against no document open

This commit is contained in:
2026-06-02 19:27:47 -04:00
parent b96edc6c8f
commit 366137e49a
+10
View File
@@ -884,6 +884,16 @@ function Bookhoard:updateProgress(ensure_networking, interactive)
if not self.settings.sync_progress then return end
if not self.ui.document then
if interactive then
UIManager:show(InfoMessage:new{
text = _("No document open."),
timeout = 3,
})
end
return
end
local now = UIManager:getElapsedTimeSinceBoot()
if not interactive and now - self.push_timestamp <= API_CALL_DEBOUNCE_DELAY then
return