From 2974265c4ad3eb437bf0f71a9bad415f1034f01c Mon Sep 17 00:00:00 2001 From: Nik Clayton Date: Mon, 20 Feb 2023 20:36:37 +0100 Subject: [PATCH] Use the adapter position when responding to clicks on followed tags (#3334) This ensures that the position is valid w.r.t. to the backing array. Fixes https://github.com/tuskyapp/Tusky/issues/3333 --- .../tusky/components/followedtags/FollowedTagsAdapter.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/components/followedtags/FollowedTagsAdapter.kt b/app/src/main/java/com/keylesspalace/tusky/components/followedtags/FollowedTagsAdapter.kt index 365900886..682d39a8a 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/followedtags/FollowedTagsAdapter.kt +++ b/app/src/main/java/com/keylesspalace/tusky/components/followedtags/FollowedTagsAdapter.kt @@ -22,7 +22,7 @@ class FollowedTagsAdapter( viewModel.tags[position].let { tag -> holder.itemView.findViewById(R.id.followed_tag).text = tag.name holder.itemView.findViewById(R.id.followed_tag_unfollow).setOnClickListener { - actionListener.unfollow(tag.name, position) + actionListener.unfollow(tag.name, holder.bindingAdapterPosition) } } }