Scrolling back and forth doesn't blow the stuff up

This commit is contained in:
CatAClock 2025-06-11 18:06:14 -07:00
parent 079badc75c
commit 43ad1b0850

View file

@ -213,6 +213,8 @@ async function PosterContainerUpdate(Direction) {
// Begin by having the website we are using get pushed to the expanded view array and clean out the HTML.
WebsiteAPIType.push("Mastodon");
i.getElementsByClassName("PostContent")[0].innerHTML = "";
i.getElementsByClassName("Username")[0].innerHTML = "";
// Public stuff
if (MastodonLoadedFeed[CurrentThing + counter + 1] == undefined) {
let TempFeed;
if (Discover == true) {
@ -227,15 +229,17 @@ async function PosterContainerUpdate(Direction) {
MastodonLoadedFeed = await MastodonLoadedFeed.concat(TempFeed);
}
// 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 + " )";
if (MastodonLoadedFeed[CurrentThing + counter].reblog != null && typeof MastodonLoadedFeed[CurrentThing + counter].reblog != "string") {
// 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
i.getElementsByClassName("Username")[0].innerHTML = " ( R: " + MastodonLoadedFeed[CurrentThing + counter].reblog + " )";
} else if (MastodonLoadedFeed[CurrentThing + counter].reblog != null && typeof MastodonLoadedFeed[CurrentThing + counter].reblog == "string") {
// this function is if the changes are already made.
i.getElementsByClassName("Username")[0].innerHTML = " ( R: " + MastodonLoadedFeed[CurrentThing + counter].reblog + " )";
}
i.getElementsByClassName("Username")[0].innerHTML = MastodonLoadedFeed[CurrentThing + counter].account.username + i.getElementsByClassName("Username")[0].innerHTML
// Check for images.
if (MastodonLoadedFeed[CurrentThing + counter].media_attachments.length != 0) {
if (MastodonLoadedFeed[CurrentThing + counter].media_attachments[0].type == "image") {