Skip to content

Commit

Permalink
Fix PR comment: tracking inverted prompt switch state
Browse files Browse the repository at this point in the history
  • Loading branch information
RenanLukas committed Jun 2, 2022
1 parent e3330e7 commit 4708597
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,9 @@ class BloggingRemindersViewModel @Inject constructor(

private fun togglePromptSwitch() {
_bloggingRemindersModel.value?.let { currentState ->
analyticsTracker.trackRemindersIncludePromptPressed(currentState.isPromptIncluded)
_bloggingRemindersModel.value = currentState.copy(isPromptIncluded = !currentState.isPromptIncluded)
val newState = !currentState.isPromptIncluded
analyticsTracker.trackRemindersIncludePromptPressed(newState)
_bloggingRemindersModel.value = currentState.copy(isPromptIncluded = newState)
}
}

Expand Down

0 comments on commit 4708597

Please sign in to comment.