Thread viewer for Bluesky

refactored extracting post id

Changed files
+4 -3
+2 -2
post.js
··· 13 13 } 14 14 15 15 get linkToPost() { 16 - return this.linkToAuthor + '/post/' + lastPathComponent(this.post.uri); 16 + return this.linkToAuthor + '/post/' + this.post.id; 17 17 } 18 18 19 19 buildElement() { ··· 143 143 link.addEventListener('click', (e) => { 144 144 e.preventDefault(); 145 145 link.innerHTML = `<img class="loader" src="sunny.png">`; 146 - loadThread(this.post.author.handle, lastPathComponent(this.post.uri), loadMore.parentNode.parentNode); 146 + loadThread(this.post.author.handle, this.post.id, loadMore.parentNode.parentNode); 147 147 }); 148 148 149 149 loadMore.appendChild(link);
+1
skythread.js
··· 60 60 repostCount: post.repostCount, 61 61 uri: post.uri, 62 62 cid: post.cid, 63 + id: lastPathComponent(post.uri), 63 64 createdAt: new Date(post.record.createdAt), 64 65 text: post.record.text, 65 66 like: post.viewer.like,
+1 -1
utils.js
··· 16 16 } 17 17 18 18 function linkToPostThread(post) { 19 - return linkToPostById(post.author.handle, lastPathComponent(post.uri)); 19 + return linkToPostById(post.author.handle, post.id); 20 20 } 21 21 22 22 function linkToPostById(handle, postId) {