Skip to content

Commit

Permalink
fix misskey cancel reaction crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Tlaster committed Jan 7, 2025
1 parent bc5ac37 commit 204c771
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.isUnspecified
import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.graphics.DefaultAlpha
import androidx.compose.ui.graphics.FilterQuality
Expand Down Expand Up @@ -92,7 +93,11 @@ internal fun EmojiImage(
val aspectRatio =
remember(painter.intrinsicSize) {
val size = painter.intrinsicSize
(size.width / size.height).takeUnless { it.isNaN() } ?: 1f
if (size.isUnspecified) {
1f
} else {
(size.width / size.height).takeUnless { it.isNaN() } ?: 1f
}
}
Image(
painter = painter,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,12 +386,20 @@ internal fun Note.renderStatus(
StatusAction.Item.Reaction(
reacted = myReaction != null,
onClicked = {
launcher.launch(
AppDeepLink.Misskey.AddReaction(
accountKey = accountKey,
if (myReaction == null) {
launcher.launch(
AppDeepLink.Misskey.AddReaction(
accountKey = accountKey,
statusKey = statusKey,
),
)
} else {
event.react(
statusKey = statusKey,
),
)
hasReacted = true,
reaction = myReaction,
)
}
},
),
StatusAction.Group(
Expand Down

0 comments on commit 204c771

Please sign in to comment.