some fixes

This commit is contained in:
Thomas 2022-08-02 10:40:27 +02:00
parent 83bacc12ea
commit 0a15ab2cf8
2 changed files with 8 additions and 7 deletions

View File

@ -153,15 +153,16 @@ public class FragmentMastodonAccount extends Fragment {
}
accountsVM.getRelationships(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, ids)
.observe(getViewLifecycleOwner(), relationShips -> {
for (RelationShip relationShip : relationShips) {
for (Account account : accounts) {
if (account.id.compareToIgnoreCase(relationShip.id) == 0) {
account.relationShip = relationShip;
if (relationShips != null) {
for (RelationShip relationShip : relationShips) {
for (Account account : accounts) {
if (account.id.compareToIgnoreCase(relationShip.id) == 0) {
account.relationShip = relationShip;
}
}
}
accountAdapter.notifyItemRangeChanged(position, accounts.size());
}
accountAdapter.notifyItemRangeChanged(position, accounts.size());
});
}

View File

@ -788,7 +788,7 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
accountsVM.getAccountStatuses(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, accountTimeline.id, null, null, null, null, null, false, true, MastodonHelper.statusesPerCall(requireActivity()))
.observe(getViewLifecycleOwner(), pinnedStatuses -> accountsVM.getAccountStatuses(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, accountTimeline.id, null, null, null, exclude_replies, exclude_reblogs, media_only, false, MastodonHelper.statusesPerCall(requireActivity()))
.observe(getViewLifecycleOwner(), otherStatuses -> {
if (otherStatuses != null && otherStatuses.statuses != null) {
if (otherStatuses != null && otherStatuses.statuses != null && pinnedStatuses != null) {
for (Status status : pinnedStatuses.statuses) {
status.pinned = true;
}