A fork of https://github.com/crosspoint-reader/crosspoint-reader
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: custom sleep not showing image at index 0 (#639)

## Summary

* Fixing custom sleep behaviour where the first image in the /sleep
directory is not shown
* image at index 0 is not being rendered when more than 1 image is
stored in /sleep directory, because `APP_STATE.lastSleepImage` is always
0.

## Additional Context

* `APP_STATE.lastSleepImage` is reset to 0 when a epub is open, this
value is only used to compare it to the randomly selected one in
`renderCustomSleepScreen()` that should always be a valid index, since
the list of valid bmp images is colected from scratch. -> no need to
reset it and block image @ index 0 from being rendered

---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? _**NO**_

Co-authored-by: Oyster <Oyster@home>

authored by

Gaspar Fabrega Ragni
Oyster
and committed by
GitHub
4dd73a21 634f6279

-1
-1
src/main.cpp
··· 329 329 // Clear app state to avoid getting into a boot loop if the epub doesn't load 330 330 const auto path = APP_STATE.openEpubPath; 331 331 APP_STATE.openEpubPath = ""; 332 - APP_STATE.lastSleepImage = 0; 333 332 APP_STATE.saveToFile(); 334 333 onGoToReader(path, MyLibraryActivity::Tab::Recent); 335 334 }