bug fix
This commit is contained in:
parent
cff163f6d0
commit
ed3519f6c4
1 changed files with 14 additions and 19 deletions
|
@ -55,34 +55,29 @@ for (let i of document.getElementsByClassName("Regular")) {
|
|||
// Selecting other posts.
|
||||
for (let i of document.getElementsByClassName("Parent")) {
|
||||
i.onclick = (event) => {
|
||||
SetThreadPost(Parentpost);
|
||||
if (i.classList.contains("Handle")) {
|
||||
window.location.href = "../../HTML/account.html?website=" + website;
|
||||
} else {
|
||||
document.location.href = "./expanded.html?website=" + website;
|
||||
}
|
||||
SetThreadPost(Parentpost, i);
|
||||
}
|
||||
}
|
||||
|
||||
for (let i of document.getElementsByClassName("GrandParent")) {
|
||||
i.onclick = (event) => {
|
||||
SetThreadPost(GrandParentpost);
|
||||
if (i.classList.contains("Handle")) {
|
||||
window.location.href = "../../HTML/account.html?website=" + website;
|
||||
} else {
|
||||
document.location.href = "./expanded.html?website=" + website;
|
||||
}
|
||||
SetThreadPost(GrandParentpost, i);
|
||||
}
|
||||
}
|
||||
|
||||
async function SetThreadPost(element) {
|
||||
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));
|
||||
} else if (website == "Bluesky") {
|
||||
let Temp = await BlueskyAPI.GetPosts(element.uri);
|
||||
element.post = Temp.posts[0];
|
||||
localStorage.setItem("post", JSON.stringify(element));
|
||||
}
|
||||
if (i.classList.contains("Handle")) {
|
||||
window.location.href = "../../HTML/account.html?website=" + website;
|
||||
} else {
|
||||
document.location.href = "./expanded.html?website=" + website;
|
||||
}
|
||||
}
|
||||
|
||||
// Functions and things.
|
||||
|
|
Loading…
Add table
Reference in a new issue