fix(custom-local-timelines): fix inconsistent actions

This fixes a "bug" where you would favorite a post, then reload the page, and favorite the post again, your favorite would not "count". As in, you would click to favorite, and the favorite would just stay as is
This commit is contained in:
LucasGGamerM 2023-05-03 08:36:16 -03:00 committed by GitHub
parent 4fc6a8a2a5
commit 0fccd0ab37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -238,7 +238,7 @@ public class FooterStatusDisplayItem extends StatusDisplayItem{
item.status, item.accountID, null,
status -> {
boost.setSelected(!status.reblogged);
AccountSessionManager.getInstance().getAccount(item.accountID).getStatusInteractionController().setReblogged(status, !status.reblogged, null, r->boostConsumer(v, r));
AccountSessionManager.getInstance().getAccount(item.accountID).getStatusInteractionController().setReblogged(status, !item.status.reblogged, null, r->boostConsumer(v, r));
}
);
return;
@ -265,7 +265,7 @@ public class FooterStatusDisplayItem extends StatusDisplayItem{
item.status, item.accountID, null,
status -> {
session.getStatusInteractionController()
.setReblogged(status, !status.reblogged, visibility, r->boostConsumer(v, r));
.setReblogged(status, !item.status.reblogged, visibility, r->boostConsumer(v, r));
boost.setSelected(status.reblogged);
dialog.dismiss();
}
@ -353,7 +353,7 @@ public class FooterStatusDisplayItem extends StatusDisplayItem{
item.status, item.accountID, null,
status -> {
favorite.setSelected(!status.favourited);
AccountSessionManager.getInstance().getAccount(item.accountID).getStatusInteractionController().setFavorited(status, !status.favourited, r->{
AccountSessionManager.getInstance().getAccount(item.accountID).getStatusInteractionController().setFavorited(status, !item.status.favourited, r->{
if (status.favourited) {
v.startAnimation(GlobalUserPreferences.reduceMotion ? opacityIn : animSet);
} else {
@ -396,7 +396,7 @@ public class FooterStatusDisplayItem extends StatusDisplayItem{
item.status, item.accountID, null,
status -> {
bookmark.setSelected(!status.bookmarked);
AccountSessionManager.getInstance().getAccount(item.accountID).getStatusInteractionController().setBookmarked(status, !status.bookmarked, r->{
AccountSessionManager.getInstance().getAccount(item.accountID).getStatusInteractionController().setBookmarked(status, !item.status.bookmarked, r->{
v.startAnimation(opacityIn);
});
}
@ -450,4 +450,4 @@ public class FooterStatusDisplayItem extends StatusDisplayItem{
return 0;
}
}
}
}