aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
diff options
context:
space:
mode:
authorCalMWolfs <94038482+CalMWolfs@users.noreply.github.com>2024-03-08 11:42:17 +1100
committerGitHub <noreply@github.com>2024-03-08 11:42:17 +1100
commit37f9c2fd312097ca539afacd6d04a24310dcd731 (patch)
tree618bd37a88068af3a7fecbca3bba9b7e892db0e1 /src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
parentc980f9c68fc0542f3a6c291648d831d96a31457c (diff)
downloadskyhanni-37f9c2fd312097ca539afacd6d04a24310dcd731.tar.gz
skyhanni-37f9c2fd312097ca539afacd6d04a24310dcd731.tar.bz2
skyhanni-37f9c2fd312097ca539afacd6d04a24310dcd731.zip
fix chat symbols showing twice (#1119)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
index a8ab6e6cd..f0456304e 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
@@ -249,8 +249,9 @@ object StringUtils {
modifyFirstChatComponent(chatComponent) { component ->
if (component is ChatComponentText) {
component as AccessorChatComponentText
- if (component.text_skyhanni().contains(toReplace)) {
- component.setText_skyhanni(component.text_skyhanni().replace(toReplace, replacement))
+ val componentText = component.text_skyhanni()
+ if (componentText.contains(toReplace)) {
+ component.setText_skyhanni(componentText.replace(toReplace, replacement))
return@modifyFirstChatComponent true
}
return@modifyFirstChatComponent false