Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
jpirnay
2026-04-27 18:45:16 +02:00
co-authored by Copilot
parent aed297b2b1
commit 066ec3d56b
6 changed files with 30 additions and 17 deletions
+4 -4
View File
@@ -112,14 +112,14 @@ void ReaderActivity::onGoToEpubReader(std::unique_ptr<Epub> epub) {
const auto epubPath = epub->getPath();
currentBookPath = epubPath;
// Long-press Confirm on RecentBooks/FileBrowser sets autoPullOnOpen so the user can ask
// for KOReader sync at open time. Route into the sync activity instead of creating the
// Long-press Confirm on RecentBooks/FileBrowser sets autoPullEpubPath so the user can
// ask for KOReader sync at open time. Route into the sync activity instead of creating the
// reader; sync's resumeReader() will create the reader once the remote position is applied.
// Pull-only mode does not need accurate local reader state, so we hand off zeros for spine/page.
auto& sync = APP_STATE.koReaderSyncSession;
if (sync.autoPullOnOpen && KOREADER_STORE.hasCredentials()) {
if (!sync.autoPullEpubPath.empty() && sync.autoPullEpubPath == epubPath && KOREADER_STORE.hasCredentials()) {
LOG_DBG("READER", "AUTO_PULL on open: %s", epubPath.c_str());
sync.autoPullOnOpen = false; // consume the flag
sync.autoPullEpubPath.clear(); // consume the flag
sync.active = true;
sync.epubPath = epubPath;
sync.spineIndex = 0;