diff options
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt index 40e16f20..cc3ea52e 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt @@ -116,9 +116,14 @@ fun frostAnswers(action: Answers.() -> Unit) { Answers.getInstance().action() } -fun frostAnswersCustom(name: String, action: CustomEvent.() -> Unit = {}) { +fun frostAnswersCustom(name: String, vararg events: Pair<String, Any>) { frostAnswers { - logCustom(CustomEvent("Frost $name").apply { action() }) + logCustom(CustomEvent("Frost $name").apply { + events.forEach { (key, value) -> + if (value is Number) putCustomAttribute(key, value) + else putCustomAttribute(key, value.toString()) + } + }) } } |