Boost fix mastodon

This commit is contained in:
CatAClock 2025-06-03 12:57:41 -07:00
parent ce844825a3
commit a27ff5211d
2 changed files with 10 additions and 8 deletions

View file

@ -83,20 +83,19 @@ async function SetThreadPost(element, i) {
// Functions and things.
async function GetPost() {
if (website == "Mastodon") {
// Check for a reblog.
if (post.reblog != null) {
document.getElementsByClassName("Handle Regular")[0].innerHTML = post.reblog + " ( R: " + post.account.username + " )";
} else {
document.getElementsByClassName("Handle Regular")[0].innerHTML = post.account.username;
}
document.getElementsByClassName("PostText Regular")[0].innerHTML = post.content;
// Set the texts. It's opposite because "setting" causes it to switch.
post = await MastodonAPI.GetStatus(post.id);
FavoriteFlipper = !(post.favourited);
BoostFlipper = !(post.reblogged);
SetFavorite();
SetBoost();
// Check for a reblog.
if (post.reblog != null) {
document.getElementsByClassName("Handle Regular")[0].innerHTML = post.reblog.account.username + " ( R: " + post.account.username + " )";
post = post.reblog;
} else {
document.getElementsByClassName("Handle Regular")[0].innerHTML = post.account.username;
}
document.getElementsByClassName("PostText Regular")[0].innerHTML = post.content;
// Show the image if it exists.
if (post.media_attachments.length != 0) {
for (let i of post.media_attachments) {

View file

@ -232,7 +232,10 @@ async function PosterContainerUpdate(Direction) {
// put the reblog into the regular post; Make changes as necessary.
if (MastodonLoadedFeed[CurrentThing + counter].reblog != null) {
i.getElementsByClassName("Username")[0].innerHTML = MastodonLoadedFeed[CurrentThing + counter].reblog.account.username + " ( R: " + MastodonLoadedFeed[CurrentThing + counter].account.username + " )";
// Fix a reblog issue.
let ReblogFix = MastodonLoadedFeed[CurrentThing + counter].account.username;
MastodonLoadedFeed[CurrentThing + counter] = MastodonLoadedFeed[CurrentThing + counter].reblog;
MastodonLoadedFeed[CurrentThing + counter].reblog = ReblogFix;
} else {
i.getElementsByClassName("Username")[0].innerHTML = MastodonLoadedFeed[CurrentThing + counter].account.username
}