This commit is contained in:
CatAClock 2025-07-16 19:24:24 -07:00
parent 4a07c41639
commit e7273174ae

View file

@ -109,7 +109,7 @@ async function GetPost() {
ApplyMedia(i, document.getElementsByClassName("Images")[0]); ApplyMedia(i, document.getElementsByClassName("Images")[0]);
} }
} }
// Now time to see if there are any parents // Now time to see if there are any parents.
let NumberOfThreads = 0; let NumberOfThreads = 0;
let TemporaryPost = post; let TemporaryPost = post;
while (TemporaryPost.in_reply_to_id != null) { while (TemporaryPost.in_reply_to_id != null) {
@ -153,13 +153,20 @@ async function GetPost() {
SetFavorite(); SetFavorite();
SetBoost(); SetBoost();
// Now time to see if there are any parents. // Now time to see if there are any parents.
if (post.hasOwnProperty("reply")) { let NumberOfThreads = 0;
let TemporaryPost = await BlueskyReplyFunction("0", post.reply.parent, post.reply.parent.author); let TemporaryPost = post;
// Now time to see if there are any grandparents. while (TemporaryPost.reply.parent != null) {
if (TemporaryPost.value.hasOwnProperty("reply")) { TemporaryPost = await BlueskyReplyFunction("0", TemporaryPost.reply.parent, TemporaryPost.reply.parent.author).posts[0];
TemporaryPost = await BlueskyReplyFunction("1", TemporaryPost.value.reply.parent, post.reply.grandparentAuthor); ThreadedPost.push(TemporaryPost);
// Any replies? Give them the thing :3
for (let i of document.getElementsByClassName(NumberOfThreads)) {
let TempID = NumberOfThreads;
i.onclick = (event) => {
SetThreadPost(ThreadedPost[TempID], i);
} }
} }
NumberOfThreads += 1;
}
} else { } else {
document.getElementsByClassName("PostText")[0].innerHTML = "Nothing to load."; document.getElementsByClassName("PostText")[0].innerHTML = "Nothing to load.";
} }