mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
CreDocument: fix document loading interferences (#4349)
When a main document is opened for displaying, some other document openings (for getting metadata or cover image) could affect the main document. Split some code from CreDocument:init() into another new method CreDocument:setupDefaultView(), that will only be called by ReaderUI when opening the main document (and not by these other openings like Book inforation, View cover...) Also speed up some of these other openings (Search, Screensaver) by using doc:loadDocument(false) to load only metadata and avoid parsing the HTML. Details in https://github.com/koreader/koreader/issues/4346#issuecomment-440036496
This commit is contained in:
@@ -263,6 +263,11 @@ function ReaderUI:init()
|
||||
document = self.document,
|
||||
})
|
||||
else
|
||||
-- load crengine default settings (from cr3.ini, some of these
|
||||
-- will be overriden by our settings by some reader modules below)
|
||||
if self.document.setupDefaultView then
|
||||
self.document:setupDefaultView()
|
||||
end
|
||||
-- make sure we render document first before calling any callback
|
||||
self:registerPostInitCallback(function()
|
||||
if not self.document:loadDocument() then
|
||||
|
||||
Reference in New Issue
Block a user