From 90d76c6412e994f1b0c7cfafe89270d0ededa7be Mon Sep 17 00:00:00 2001 From: rhunk <101876869+rhunk@users.noreply.github.com> Date: Wed, 27 Dec 2023 17:10:40 +0100 Subject: [PATCH] fix(core): chat message bind view event --- .../rhunk/snapenhance/core/event/events/impl/BindViewEvent.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/main/kotlin/me/rhunk/snapenhance/core/event/events/impl/BindViewEvent.kt b/core/src/main/kotlin/me/rhunk/snapenhance/core/event/events/impl/BindViewEvent.kt index 5dc4ad6c..7ea39229 100644 --- a/core/src/main/kotlin/me/rhunk/snapenhance/core/event/events/impl/BindViewEvent.kt +++ b/core/src/main/kotlin/me/rhunk/snapenhance/core/event/events/impl/BindViewEvent.kt @@ -1,6 +1,7 @@ package me.rhunk.snapenhance.core.event.events.impl import android.view.View +import android.widget.LinearLayout import me.rhunk.snapenhance.core.event.Event class BindViewEvent( @@ -9,6 +10,7 @@ class BindViewEvent( val view: View ): Event() { inline fun chatMessage(block: (conversationId: String, messageId: String) -> Unit) { + if (view !is LinearLayout) return val modelToString = prevModel.toString() if (!modelToString.startsWith("ChatViewModel")) return modelToString.substringAfter("messageId=").substringBefore(",").split(":").apply {