From 81f4770618771284fe6767293651a35d42c6083e Mon Sep 17 00:00:00 2001 From: Gaspar Fabrega Ragni Date: Sun, 1 Feb 2026 05:22:52 -0300 Subject: [PATCH] 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 --- src/main.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index f099cba1..89c4e13c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -329,7 +329,6 @@ void setup() { // Clear app state to avoid getting into a boot loop if the epub doesn't load const auto path = APP_STATE.openEpubPath; APP_STATE.openEpubPath = ""; - APP_STATE.lastSleepImage = 0; APP_STATE.saveToFile(); onGoToReader(path, MyLibraryActivity::Tab::Recent); }