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 = - `
`; + 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 = + ``; const replies = await this.#fetchReplies(atUri); this.#displayReplies(replies); } catch (e) {