Skip to content

Commit

Permalink
Optimiazation
Browse files Browse the repository at this point in the history
  • Loading branch information
ruixhuang committed Mar 28, 2024
1 parent 5ce6ac8 commit f089212
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.filterNotNull
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.onEach

class DydxUserTrackingWorker(
Expand Down Expand Up @@ -49,11 +50,12 @@ class DydxUserTrackingWorker(
.launchIn(scope)

abacusStateManager.state.selectedSubaccount
.map { it?.subaccountNumber }
.distinctUntilChanged()
.onEach {
tracker.setUserProperties(
mapOf(
UserProperty.subaccountNumber.rawValue to it?.subaccountNumber.let { subaccountNumber -> subaccountNumber?.toString() },
UserProperty.subaccountNumber.rawValue to it?.let { subaccountNumber -> subaccountNumber?.toString() },
),
)
}
Expand Down

0 comments on commit f089212

Please sign in to comment.