Skip to content

Commit 3d98b0e

Browse files
committed
fix(analytics): actually put amount properties in asProperties maps
Fiat.asProperties() and LocalFiat.asProperties() built pairs with bare `to` expressions inside buildMap without put(), so the resulting maps were empty and every transfer/onramp/wallet event was sent to Mixpanel without Fiat/Currency/USDC/Quarks (and Exchange Rate/Mint) properties.
1 parent de4766b commit 3d98b0e

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

  • apps/flipcash/shared/analytics/src/main/kotlin/com/flipcash/app/analytics

apps/flipcash/shared/analytics/src/main/kotlin/com/flipcash/app/analytics/Events.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -300,20 +300,20 @@ internal sealed interface AnalyticsEvent {
300300
internal fun LocalFiat.asProperties(): Map<String, String> {
301301
return buildMap {
302302
putAll(underlyingTokenAmount.asProperties())
303-
"Fiat" to nativeAmount.decimalValue.toString()
304-
"Exchange Rate" to rate.fx.toString()
305-
"Currency" to rate.currency.name
306-
"Mint" to mint.base58()
303+
put("Fiat", nativeAmount.decimalValue.toString())
304+
put("Exchange Rate", rate.fx.toString())
305+
put("Currency", rate.currency.name)
306+
put("Mint", mint.base58())
307307
}
308308
}
309309

310310

311311
internal fun Fiat.asProperties(): Map<String, String> {
312312
return buildMap {
313-
"Fiat" to decimalValue.toString()
314-
"Currency" to currencyCode.name
315-
"USDC" to decimalValue.toString()
316-
"Quarks" to quarks.toDouble().toString()
313+
put("Fiat", decimalValue.toString())
314+
put("Currency", currencyCode.name)
315+
put("USDC", decimalValue.toString())
316+
put("Quarks", quarks.toDouble().toString())
317317
}
318318
}
319319

0 commit comments

Comments
 (0)