Skip to content

Commit

Permalink
Fix an issue of missing faked endpoints at app startup
Browse files Browse the repository at this point in the history
  • Loading branch information
hichamboushaba committed Feb 18, 2025
1 parent 6d4b229 commit 4e48db1
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ internal class ApiFakerConfig @Inject constructor(
endpointDao.observeEndpointsCount().map { it == 0 }
) { pref, isEmpty ->
pref && !isEmpty
}.stateIn(configScope, SharingStarted.Eagerly, false)
}.stateIn(
scope = configScope,
started = SharingStarted.WhileSubscribed(),
initialValue = preferences.getBoolean(PREFERENCE_KEY, false)
)

fun setStatus(enabled: Boolean) {
preferences.edit().putBoolean(PREFERENCE_KEY, enabled).apply()
Expand Down

0 comments on commit 4e48db1

Please sign in to comment.