Pref fixes (#3175)

This commit is contained in:
Phil Oliver 2025-09-23 15:52:09 -04:00 committed by James Rich
parent c5c433c165
commit a1d9f926cb
7 changed files with 99 additions and 29 deletions

View file

@ -81,6 +81,7 @@ import kotlinx.coroutines.flow.shareIn
import kotlinx.coroutines.flow.stateIn
import kotlinx.coroutines.flow.update
import kotlinx.coroutines.launch
import org.meshtastic.core.datastore.UiPreferencesDataSource
import org.meshtastic.core.model.DeviceHardware
import org.meshtastic.core.prefs.ui.UiPrefs
import org.meshtastic.core.strings.R
@ -188,11 +189,12 @@ constructor(
private val quickChatActionRepository: QuickChatActionRepository,
firmwareReleaseRepository: FirmwareReleaseRepository,
private val uiPrefs: UiPrefs,
private val uiPreferencesDataSource: UiPreferencesDataSource,
private val meshServiceNotifications: MeshServiceNotifications,
) : ViewModel(),
Logging {
val theme: StateFlow<Int> = uiPrefs.themeFlow
val theme: StateFlow<Int> = uiPreferencesDataSource.theme
private val _lastTraceRouteTime = MutableStateFlow<Long?>(null)
val lastTraceRouteTime: StateFlow<Long?> = _lastTraceRouteTime.asStateFlow()
@ -822,9 +824,9 @@ constructor(
nodeFilterText.value = text
}
val appIntroCompleted: StateFlow<Boolean> = uiPrefs.appIntroCompletedFlow
val appIntroCompleted: StateFlow<Boolean> = uiPreferencesDataSource.appIntroCompleted
fun onAppIntroCompleted() {
uiPrefs.appIntroCompleted = true
uiPreferencesDataSource.setAppIntroCompleted(true)
}
}