fix bug where unmuting would unmute wrong account

main
Conny Duck 6 years ago
parent 829229a692
commit 46518853ff
  1. 6
      app/src/main/java/com/keylesspalace/tusky/adapter/MutesAdapter.java

@ -46,7 +46,7 @@ public class MutesAdapter extends AccountAdapter {
if (position < accountList.size()) { if (position < accountList.size()) {
MutedUserViewHolder holder = (MutedUserViewHolder) viewHolder; MutedUserViewHolder holder = (MutedUserViewHolder) viewHolder;
holder.setupWithAccount(accountList.get(position)); holder.setupWithAccount(accountList.get(position));
holder.setupActionListener(accountActionListener, position); holder.setupActionListener(accountActionListener);
} else { } else {
FooterViewHolder holder = (FooterViewHolder) viewHolder; FooterViewHolder holder = (FooterViewHolder) viewHolder;
holder.setState(footerState); holder.setState(footerState);
@ -90,8 +90,8 @@ public class MutesAdapter extends AccountAdapter {
.into(avatar); .into(avatar);
} }
void setupActionListener(final AccountActionListener listener, final int position) { void setupActionListener(final AccountActionListener listener) {
unmute.setOnClickListener(v -> listener.onMute(false, id, position)); unmute.setOnClickListener(v -> listener.onMute(false, id, getAdapterPosition()));
avatar.setOnClickListener(v -> listener.onViewAccount(id)); avatar.setOnClickListener(v -> listener.onViewAccount(id));
} }
} }

Loading…
Cancel
Save