[plugin] Exporter: ensure we're connected before sending highlights (#8604)

reviewable/pr8618/r1
Dylan Garrett 2 years ago committed by GitHub
parent 11d329d20f
commit 19c13b8a32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -299,7 +299,8 @@ For more information, please visit https://github.com/koreader/koreader/wiki/Hig
return not self:isDocless() and self:readyToExport() and not self.txt_export
end,
callback = function()
UIManager:scheduleIn(0.5, function()
local export_callback = function()
UIManager:nextTick(function()
self:exportCurrentNotes(self.view)
end)
@ -308,6 +309,12 @@ For more information, please visit https://github.com/koreader/koreader/wiki/Hig
timeout = 1,
})
end
if self.joplin_export or self.readwise_export then
NetworkMgr:runWhenOnline(export_callback)
else
export_callback()
end
end
},
{
text = _("Export all notes in your library"),
@ -315,7 +322,8 @@ For more information, please visit https://github.com/koreader/koreader/wiki/Hig
return self:readyToExport()
end,
callback = function()
UIManager:scheduleIn(0.5, function()
local export_callback = function()
UIManager:nextTick(function()
self:exportAllNotes()
end)
@ -323,6 +331,13 @@ For more information, please visit https://github.com/koreader/koreader/wiki/Hig
text = _("Exporting may take several minutes…"),
timeout = 1,
})
end
if self.joplin_export or self.readwise_export then
NetworkMgr:runWhenOnline(export_callback)
else
export_callback()
end
end,
separator = true,
},

Loading…
Cancel
Save