Skip to content

Commit

Permalink
Make sure action event is tracked when handleAction is called
Browse files Browse the repository at this point in the history
initState can be called from other places, so it's not the right place to send the event.

COAND-845
  • Loading branch information
OscarSpruit committed May 24, 2024
1 parent 220f737 commit b6d5936
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ internal class DefaultAwaitDelegate(

this.action = action

val event = GenericEvents.action(
component = action.paymentMethodType.orEmpty(),
subType = action.type.orEmpty(),
)
analyticsManager?.trackEvent(event)

initState(action)
}

Expand All @@ -137,12 +143,6 @@ internal class DefaultAwaitDelegate(
}
createOutputData(null, action)

val event = GenericEvents.action(
component = action.paymentMethodType.orEmpty(),
subType = action.type.orEmpty(),
)
analyticsManager?.trackEvent(event)

startStatusPolling(paymentData, action)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ internal class DefaultVoucherDelegate(

this.action = action

val event = GenericEvents.action(
component = action.paymentMethodType.orEmpty(),
subType = action.type.orEmpty(),
)
analyticsManager?.trackEvent(event)

initState(action)
}

Expand All @@ -130,12 +136,6 @@ internal class DefaultVoucherDelegate(
return
}

val event = GenericEvents.action(
component = action.paymentMethodType.orEmpty(),
subType = action.type.orEmpty(),
)
analyticsManager?.trackEvent(event)

_viewFlow.tryEmit(config.viewType)

createOutputData(action, config)
Expand Down

0 comments on commit b6d5936

Please sign in to comment.