Guard push against no document open
This commit is contained in:
@@ -884,6 +884,16 @@ function Bookhoard:updateProgress(ensure_networking, interactive)
|
|||||||
|
|
||||||
if not self.settings.sync_progress then return end
|
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()
|
local now = UIManager:getElapsedTimeSinceBoot()
|
||||||
if not interactive and now - self.push_timestamp <= API_CALL_DEBOUNCE_DELAY then
|
if not interactive and now - self.push_timestamp <= API_CALL_DEBOUNCE_DELAY then
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user