From 1fa706a2c594d071172216b7340363d5edf791ae Mon Sep 17 00:00:00 2001 From: poire-z Date: Fri, 11 Nov 2022 21:43:27 +0100 Subject: [PATCH] Fix page stats messed up after rerendering (#9775) Fix regression introduced by 48eb0231 #9651: on re-rerendering, the new pages count didn't reach the Statistics plugin. So, if you change font size or margins, the stats for the page read since then were badly accounted, until a change of book or restart... I noticed that in Book map, strange nobody else did over the last 2.5 weeks. --- frontend/apps/reader/modules/readertoc.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/apps/reader/modules/readertoc.lua b/frontend/apps/reader/modules/readertoc.lua index d9aa5db19..cd7a78e40 100644 --- a/frontend/apps/reader/modules/readertoc.lua +++ b/frontend/apps/reader/modules/readertoc.lua @@ -110,7 +110,9 @@ function ReaderToc:onUpdateToc() end -- Be sure to update the ToC after a CRE rerendering -ReaderToc.onDocumentRerendered = ReaderToc.onUpdateToc +function ReaderToc:onDocumentRerendered() + self:onUpdateToc() +end function ReaderToc:onPageUpdate(pageno) if UIManager.FULL_REFRESH_COUNT == -1 or G_reader_settings:isTrue("refresh_on_chapter_boundaries") then