Skip to content

Commit

Permalink
fix: bug
Browse files Browse the repository at this point in the history
  • Loading branch information
pantasystem committed Aug 5, 2023
1 parent 4fb8032 commit 91659b6
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package net.pantasystem.milktea.common_android_ui

import android.content.Context
import android.util.Log
import android.view.View
import android.widget.FrameLayout
import android.widget.ImageView
Expand Down Expand Up @@ -72,15 +71,14 @@ object ReactionViewHelper {
//Log.d("ReactionViewHelper", "reaction $reaction")
if (reaction.startsWith(":") && reaction.endsWith(":")) {
val account = accountStore.currentAccount
val emojis = if (account?.normalizedInstanceUri != null) {
cache.get(account.normalizedInstanceUri) ?: emptyList()
val emojis = if (account?.getHost() != null) {
cache.getAndConvertToMap(account.getHost()) ?: emptyMap()
} else {
emptyList()
}
val emoji = emojis.firstOrNull {
it.name == reaction.replace(":", "")
emptyMap()
}

val emoji = emojis[reaction.replace(":", "")]

if (emoji != null) {
//Log.d("ReactionViewHelper", "カスタム絵文字を発見した: ${emoji}")
if (emoji.cachePath == null) {
Expand All @@ -101,7 +99,6 @@ object ReactionViewHelper {
reactionStringView.setMemoVisibility(View.GONE)
return
} else {
Log.d("ReactionViewHelper", "emoji not found")
reactionImageView.setMemoVisibility(View.GONE)
reactionStringView.setMemoVisibility(View.VISIBLE)
}
Expand Down

0 comments on commit 91659b6

Please sign in to comment.