fix: long-press back should move to the start of chapter (#2243)

Co-authored-by: Julia <julia@uxj.io>
This commit is contained in:
Uri Tauber
2026-06-04 16:35:38 +03:00
committed by GitHub
co-authored by Julia
parent bb078bae09
commit f055fdd774
+11 -1
View File
@@ -338,11 +338,21 @@ void EpubReaderActivity::loop() {
}
if (longPress && SETTINGS.longPressButtonBehavior == SETTINGS.CHAPTER_SKIP) {
if (!nextTriggered && section && section->currentPage > 0) {
section->currentPage = 0;
requestUpdate();
return;
}
// We don't want to delete the section mid-render, so grab the semaphore
{
RenderLock lock(*this);
nextPageNumber = 0;
currentSpineIndex = nextTriggered ? currentSpineIndex + 1 : currentSpineIndex - 1;
if (nextTriggered) {
currentSpineIndex++;
} else if (currentSpineIndex > 0) {
currentSpineIndex--;
}
section.reset();
}
requestUpdate();