We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 9d363e5 + 5e1d803 commit 4755ca1Copy full SHA for 4755ca1
1 file changed
app/src/main/java/com/getcode/view/main/home/HomeViewModel.kt
@@ -201,12 +201,14 @@ class HomeViewModel @Inject constructor(
201
init {
202
onDrawn()
203
204
- viewModelScope.launch {
205
- val cameraAutoStart = appSettings.get(PrefsBool.CAMERA_START_BY_DEFAULT)
206
- uiFlow.update {
207
- it.copy(autoStartCamera = cameraAutoStart)
208
- }
209
+ appSettings.observe()
+ .map { it.cameraStartByDefault }
+ .distinctUntilChanged()
+ .onEach {cameraAutoStart ->
+ uiFlow.update {
+ it.copy(autoStartCamera = cameraAutoStart)
210
+ }
211
+ }.launchIn(viewModelScope)
212
213
betaFlags.observe()
214
.distinctUntilChanged()
0 commit comments