From 1fe27c3d6a0cdcd6ed43074eaa804674b20ad122 Mon Sep 17 00:00:00 2001 From: pubmania Date: Mon, 9 Dec 2024 18:53:42 +0000 Subject: [PATCH] fixed bug - join conversation link was not working. --- docs/assets/js/src/BlueskyComments.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/assets/js/src/BlueskyComments.js b/docs/assets/js/src/BlueskyComments.js index fa4e156..3509890 100644 --- a/docs/assets/js/src/BlueskyComments.js +++ b/docs/assets/js/src/BlueskyComments.js @@ -187,14 +187,18 @@ export class BlueskyComments extends HTMLElement { if (!blueskyUrl) { blueskyUrl = this.getAttribute("url"); } - this.shadowRoot.querySelector(".comments").innerHTML = - `

Join the conversation on Bluesky....

`; + if (blueskyUrl) { try { const atUri = await this.#resolvePostUrl(blueskyUrl); if (!atUri) { throw new Error("Failed to resolve AT URI"); } + const urlParts = (atUri).split("/"); + const postId = urlParts[4]; + console.log(postId) + this.shadowRoot.querySelector(".comments").innerHTML = + `

Join the conversation on Bluesky....

`; const replies = await this.#fetchReplies(atUri); this.#displayReplies(replies); } catch (e) {