diff --git a/src/activities/boot_sleep/SleepActivity.cpp b/src/activities/boot_sleep/SleepActivity.cpp index 1d1c27a8..7df9fcb2 100644 --- a/src/activities/boot_sleep/SleepActivity.cpp +++ b/src/activities/boot_sleep/SleepActivity.cpp @@ -81,8 +81,10 @@ void SleepActivity::renderCustomSleepScreen() const { if (numFiles > 0) { // Generate a random number between 1 and numFiles const auto randomFileIndex = random(numFiles); - // If we re-generated the same index as the last sleep screen, use the next one (modulo the number of files we have) - const auto realFileIndex = randomFileIndex == SETTINGS.lastUsedSleep? randomFileIndex+1 % numFiles : randomFileIndex; + // If we re-generated the same index as the last sleep screen, + // use the next one (modulo the number of files we have) + const auto realFileIndex = + randomFileIndex == SETTINGS.lastUsedSleep ? randomFileIndex + 1 % numFiles : randomFileIndex; SETTINGS.lastUsedSleep = realFileIndex; SETTINGS.saveToFile(); const auto filename = "/sleep/" + files[realFileIndex];