From a412ed531c7f980cf7db4e752a437ba42e0f2aec Mon Sep 17 00:00:00 2001 From: CatAClock Date: Sun, 11 May 2025 19:39:38 -0700 Subject: [PATCH] bsky stuff now works as intended --- JS/expanded.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/JS/expanded.js b/JS/expanded.js index 497f650..d6f1898 100644 --- a/JS/expanded.js +++ b/JS/expanded.js @@ -60,7 +60,7 @@ async function GetPost() { } // Update the post to see if there is new information. post = await MastodonAPI.GetStatus(post.id); - // Set the texts. + // Set the texts. It's opposite because "setting" causes it to switch. FavoriteFlipper = !(post.favourite); BoostFlipper = !(post.reblogged); SetFavorite(); @@ -81,8 +81,17 @@ async function GetPost() { } } // We don't need to update the post with new information. The repos are seperate. - // Set the texts. - // TODO! + // Set the texts. It's opposite because "setting" causes it to switch. + let GetRepo = await BlueskyAPI.GetRecord(localStorage.getItem(Variables.BlueskyDID), "app.bsky.feed.like", post.post.uri.split("/")[post.post.uri.split("/").length - 1]); + if (GetRepo.hasOwnProperty("error") && GetRepo.error == "RecordNotFound") { + FavoriteFlipper = true; + } + GetRepo = await BlueskyAPI.GetRecord(localStorage.getItem(Variables.BlueskyDID), "app.bsky.feed.repost", post.post.uri.split("/")[post.post.uri.split("/").length - 1]); + if (GetRepo.hasOwnProperty("error") && GetRepo.error == "RecordNotFound") { + BoostFlipper = true; + } + SetFavorite(); + SetBoost(); } else { document.getElementsByClassName("PostText")[0].innerHTML = "Nothing to load."; }