Thread viewer for Bluesky

refactored extracting post id

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