fixing ui stuff

This commit is contained in:
Joren de Graaf
2026-10-09 19:10:42 +02:00
parent dad0001df1
commit 2b0bbdd201
12 changed files with 175 additions and 27 deletions
@@ -131,6 +131,24 @@ void BoomState::incrementTodayEvents() {
preferences_.putInt("today", value);
}
void BoomState::discardTodayEvents(int count) {
if (count <= 0) return;
rollDayIfNeeded();
int value;
xSemaphoreTake(mutex_, portMAX_DELAY);
state_.todayEvents = max(0, state_.todayEvents - count);
value = state_.todayEvents;
xSemaphoreGive(mutex_);
preferences_.putInt("today", value);
}
void BoomState::resetTodayEvents() {
xSemaphoreTake(mutex_, portMAX_DELAY);
state_.todayEvents = 0;
xSemaphoreGive(mutex_);
preferences_.putInt("today", 0);
}
void BoomState::requestSync(const String& filename) {
xSemaphoreTake(mutex_, portMAX_DELAY);
syncRequested_ = true;