Skip to content

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

Merged
daveallie merged 1 commit intocrosspoint-reader:masterfrom
gasparzilla:fix-last-sleep-image-reset
Feb 1, 2026
Merged

fix: custom sleep not showing image at index 0#639
daveallie merged 1 commit intocrosspoint-reader:masterfrom
gasparzilla:fix-last-sleep-image-reset

Conversation

@gasparzilla
Copy link
Contributor

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

@gasparzilla gasparzilla changed the title fix: fixing custom sleep not showing image at index 0 fix: custom sleep not showing image at index 0 Feb 1, 2026
@daveallie
Copy link
Member

Thanks! This was a bug I saw a few people report, but I didn't get to it

@daveallie daveallie merged commit 4dd73a2 into crosspoint-reader:master Feb 1, 2026
3 checks passed
lukestein pushed a commit to lukestein/crosspoint-reader that referenced this pull request Feb 1, 2026
## 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>
jdk2pq added a commit to jdk2pq/crosspoint-reader that referenced this pull request Feb 3, 2026
* master:
  feat: Debugging monitor script (crosspoint-reader#555)
  fix: truncating chapter titles using UTF-8 safe function (crosspoint-reader#599)
  fix: don't wake up after USB connect (crosspoint-reader#644)
  Revert "fix: don't wake up after USB connect" (crosspoint-reader#643)
  fix: custom sleep not showing image at index 0 (crosspoint-reader#639)
  docs: Update USER_GUIDE.md (crosspoint-reader#625)
  fix: Hide button hints in landscape CW mode (crosspoint-reader#637)
  fix: WiFi error screen text clarifications (crosspoint-reader#612)
  fix: don't wake up after USB connect (crosspoint-reader#576)
  feat(ui): change popup logic (crosspoint-reader#442)
  feat: Add reading menu and delete cache function (crosspoint-reader#433)
lukestein pushed a commit to lukestein/crosspoint-reader that referenced this pull request Feb 3, 2026
## 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>
lukestein pushed a commit to lukestein/crosspoint-reader that referenced this pull request Feb 3, 2026
## 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>
Unintendedsideeffects pushed a commit to Unintendedsideeffects/crosspoint-reader that referenced this pull request Feb 17, 2026
## 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants