Skip to content

Commit

Permalink
fix: delay for not overload toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
yamilmedina committed Sep 17, 2024
1 parent ff55753 commit 0f3b2d3
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,14 @@ class PrivacySettingsViewModel @Inject constructor(
fun setAnonymousUsageDataEnabled(enabled: Boolean) {
viewModelScope.launch {
dataStore.setIsAnonymousAnalyticsEnabled(enabled)
delay(DELAY)
delay(DELAY_FOR_ANALYTICS_STORAGE_SDK)
state = state.copy(
isAnalyticsUsageEnabled = enabled
)
}

}

companion object {
private const val DELAY = 1_000L
private const val DELAY_FOR_ANALYTICS_STORAGE_SDK = 1_000L
}
}

0 comments on commit 0f3b2d3

Please sign in to comment.