Fix style problem

This commit is contained in:
Will Morrow 2026-01-09 19:55:30 -05:00
parent 3819448945
commit fedfb80258
No known key found for this signature in database
GPG Key ID: 6B48220F9432DACE

View File

@ -81,8 +81,10 @@ void SleepActivity::renderCustomSleepScreen() const {
if (numFiles > 0) { if (numFiles > 0) {
// Generate a random number between 1 and numFiles // Generate a random number between 1 and numFiles
const auto randomFileIndex = random(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) // If we re-generated the same index as the last sleep screen,
const auto realFileIndex = randomFileIndex == SETTINGS.lastUsedSleep? randomFileIndex+1 % numFiles : randomFileIndex; // 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.lastUsedSleep = realFileIndex;
SETTINGS.saveToFile(); SETTINGS.saveToFile();
const auto filename = "/sleep/" + files[realFileIndex]; const auto filename = "/sleep/" + files[realFileIndex];