Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ohassine committed Jan 20, 2025
1 parent f66bdb0 commit b979835
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,8 @@ class CurrentScreenManager @Inject constructor(

override fun onDestinationChanged(controller: NavController, destination: NavDestination, arguments: Bundle?) {
val currentScreenName = currentScreenName()
currentScreenName?.let {
AnonymousAnalyticsManagerImpl.stopView(it)
}
AnonymousAnalyticsManagerImpl.stopView(currentScreenName)


val currentItem = destination.toDestination()
currentScreenState.value = CurrentScreen.fromDestination(
Expand All @@ -137,9 +136,7 @@ class CurrentScreenManager @Inject constructor(
)

val newScreenName = currentScreenName()
newScreenName?.let {
AnonymousAnalyticsManagerImpl.recordView(it)
}
AnonymousAnalyticsManagerImpl.recordView(newScreenName)
}

private fun currentScreenName() = currentScreenState.value.let { currentScreen ->
Expand Down

0 comments on commit b979835

Please sign in to comment.