feat: footnote returns to original position on deep sleep to avoid losing reading position (#2394)

This commit is contained in:
Zeph
2026-06-22 15:28:42 +03:00
committed by GitHub
parent 282514f755
commit 0ce874f8d4
2 changed files with 10 additions and 0 deletions
@@ -177,6 +177,14 @@ void EpubReaderActivity::onExit() {
APP_STATE.readerActivityLoadCount = 0;
APP_STATE.saveToFile();
// Leaving mid-footnote loses the in-RAM return stack on deep sleep; persist the
// pre-footnote position so the book reopens at the link origin, not the footnote.
if (footnoteDepth > 0 && epub) {
const SavedPosition& origin = savedPositions[0];
saveProgress(origin.spineIndex, origin.pageNumber, 0);
}
section.reset();
if (pendingReadFolderMove && epub) {
const std::string srcPath = epub->getPath();