AT-based link agregator. Mirror of https://github.com/likeandscribe/frontpage

Better comment alert

tom.sherman.is 5ebd8133 52e8a29b

verified
+10 -9
+10 -9
packages/frontpage/app/api/receive_hook/handlers.ts
··· 254 254 } 255 255 256 256 const bskyProfile = await getBlueskyProfile(repo); 257 + const postUrl = `https://frontpage.fyi/post/${comment.postUri.host}/${comment.postUri.rkey}`; 257 258 await sendDiscordMessage({ 258 259 embeds: [ 259 260 { 260 261 title: `New ${comment.$type} on Frontpage`, 261 262 description: comment.content, 262 - url: `https://frontpage.fyi/post/${repo}/${rkey}`, 263 + url: `${postUrl}/${repo}/${rkey}`, 263 264 color: 10181046, 264 265 author: bskyProfile 265 266 ? { ··· 268 269 url: `https://frontpage.fyi/profile/${bskyProfile.handle}`, 269 270 } 270 271 : undefined, 271 - fields: [ 272 - { 273 - name: "Context", 274 - value: comment.parentUri 275 - ? `https://frontpage.fyi/post/${comment.postUri.host}/${comment.postUri.rkey}/${comment.parentUri.host}/${comment.parentUri.rkey}` 276 - : `https://frontpage.fyi/post/${comment.postUri.host}/${comment.postUri.rkey}`, 277 - }, 278 - ], 272 + fields: comment.parentUri 273 + ? [ 274 + { 275 + name: "Context", 276 + value: `${postUrl}/${comment.parentUri.host}/${comment.parentUri.rkey}`, 277 + }, 278 + ] 279 + : [], 279 280 }, 280 281 ], 281 282 });