fix bug where unmuting would unmute wrong account

This commit is contained in:
Conny Duck 2018-08-12 20:19:44 +02:00
parent 4f50bb5566
commit aa64a879f1

View file

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