chore: add Firebase Crashlytics settings and fix temperature unit toggle state handling

This commit is contained in:
2026-06-12 10:28:36 +01:00
parent 7653876fed
commit 6c57086f25
3 changed files with 31 additions and 1 deletions
@@ -6,7 +6,9 @@ import com.example.esp32aldldashboard.bluetooth.ConnectionState
import com.example.esp32aldldashboard.parser.ALDLFrame
import com.example.esp32aldldashboard.repository.SettingsRepository
import com.example.esp32aldldashboard.repository.TelemetryRepository
import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.stateIn
import kotlinx.coroutines.launch
class MainScreenViewModel(
@@ -24,10 +26,11 @@ class MainScreenViewModel(
val currentFrameRate: StateFlow<Int> = telemetryRepository.currentFrameRate
val isCelsius: StateFlow<Boolean> = settingsRepository.isCelsiusFlow
.stateIn(viewModelScope, SharingStarted.WhileSubscribed(5000), false)
fun toggleTemperatureUnit() {
viewModelScope.launch {
val currentValue = settingsRepository.isCelsiusFlow.value
val currentValue = isCelsius.value
settingsRepository.setIsCelsius(!currentValue)
}
}