this should work

This commit is contained in:
CatAClock 2025-07-16 19:59:55 -07:00
parent e2b5c53ac5
commit 2ce7b6d725

View file

@ -74,6 +74,13 @@ for (let i of document.getElementsByClassName("Regular")) {
// Threads are the thing above the post you clicked. // Threads are the thing above the post you clicked.
async function SetThreadPost(element, i) { async function SetThreadPost(element, i) {
if (website == "Mastodon") {
localStorage.setItem("post", JSON.stringify(element));
} else if (website == "Bluesky") {
let Temp = await BlueskyAPI.GetPosts(element.uri);
element.post = Temp.posts[0];
localStorage.setItem("post", JSON.stringify(element));
}
localStorage.setItem("post", JSON.stringify(element)); localStorage.setItem("post", JSON.stringify(element));
if (i.classList.contains("Handle")) { if (i.classList.contains("Handle")) {
window.location.href = "/account?website=" + website; window.location.href = "/account?website=" + website;
@ -150,7 +157,6 @@ async function GetPost() {
let NumberOfThreads = 0; let NumberOfThreads = 0;
let TemporaryPost = post; let TemporaryPost = post;
while (TemporaryPost.hasOwnProperty("reply")) { while (TemporaryPost.hasOwnProperty("reply")) {
console.log(TemporaryPost);
TemporaryPost = await BlueskyReplyFunction(NumberOfThreads, TemporaryPost.reply.parent); TemporaryPost = await BlueskyReplyFunction(NumberOfThreads, TemporaryPost.reply.parent);
ThreadedPost.push(TemporaryPost); ThreadedPost.push(TemporaryPost);
// Any replies? Give them the thing :3 // Any replies? Give them the thing :3
@ -204,6 +210,10 @@ async function BlueskyReplyFunction(Id, post) {
ApplyMedia(OtherPost.record.embed, document.getElementsByClassName("Images " + Id)[0], post.author.did); ApplyMedia(OtherPost.record.embed, document.getElementsByClassName("Images " + Id)[0], post.author.did);
} }
} }
// Get the reply and make it make sense.
if (OtherPost.record.hasOwnProperty("reply")) {
OtherPost.reply = OtherPost.record.reply;
}
return OtherPost; return OtherPost;
} }