diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/EmojiReactionsStatusDisplayItem.java b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/EmojiReactionsStatusDisplayItem.java index ad78f522af..b776ddbb76 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/EmojiReactionsStatusDisplayItem.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/EmojiReactionsStatusDisplayItem.java @@ -276,7 +276,11 @@ private void addEmojiReaction(String emoji, Emoji info) { item.createRequest(emoji, existing==null ? 1 : existing.count, false, null, (status)->{ resetBtn.run(); if(finalExisting==null){ - int pos=item.status.reactions.size(); + int pos=status.reactions.stream() + .filter(r->r.name.equals(info!=null ? info.shortcode : emoji)) + .findFirst() + .map(r->status.reactions.indexOf(r)) + .orElse(item.status.reactions.size()); boolean previouslyEmpty=item.status.reactions.isEmpty(); item.status.reactions.add(pos, info!=null ? EmojiReaction.of(info, me) : EmojiReaction.of(emoji, me)); if(previouslyEmpty)