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

@ -47,6 +47,7 @@ import kotlinx.coroutines.flow.stateIn
import kotlinx.coroutines.flow.update
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import org.meshtastic.core.datastore.UiPreferencesDataSource
import org.meshtastic.core.prefs.ui.UiPrefs
import java.io.BufferedWriter
import java.io.FileNotFoundException
@ -65,6 +66,7 @@ constructor(
private val nodeRepository: NodeRepository,
private val meshLogRepository: MeshLogRepository,
private val uiPrefs: UiPrefs,
private val uiPreferencesDataSource: UiPreferencesDataSource,
) : ViewModel(),
Logging {
val myNodeInfo: StateFlow<MyNodeEntity?> = nodeRepository.myNodeInfo
@ -109,11 +111,11 @@ constructor(
}
fun setTheme(theme: Int) {
uiPrefs.theme = theme
uiPreferencesDataSource.setTheme(theme)
}
fun showAppIntro() {
uiPrefs.appIntroCompleted = false
uiPreferencesDataSource.setAppIntroCompleted(false)
}
fun unlockExcludedModules() {