mirror of
https://github.com/status-im/sourcecred.git
synced 2025-02-26 03:05:13 +00:00
discourse: fix post urls
The previous code incorrectly constructed a Discourse post url based on the post's id, rather than its index within the containing topic. This is now fixed. Test plan: There isn't actually a snapshot diff, because the post with id 2 is also the second post in its thread. I'm not too worried about this, though: this kind of code changes infrequently, and it's pretty obvious when it's wrong.
This commit is contained in:
parent
c082b8faf2
commit
cedc8e8fe5
@ -59,7 +59,9 @@ export function postNode(
|
|||||||
post: Post,
|
post: Post,
|
||||||
topicTitle: string
|
topicTitle: string
|
||||||
): Node {
|
): Node {
|
||||||
const url = `${serverUrl}/t/${String(post.topicId)}/${String(post.id)}`;
|
const url = `${serverUrl}/t/${String(post.topicId)}/${String(
|
||||||
|
post.indexWithinTopic
|
||||||
|
)}`;
|
||||||
const descr = `[post #${post.indexWithinTopic} on ${topicTitle}](${url})`;
|
const descr = `[post #${post.indexWithinTopic} on ${topicTitle}](${url})`;
|
||||||
const address = postAddress(serverUrl, post.id);
|
const address = postAddress(serverUrl, post.id);
|
||||||
return {timestampMs: post.timestampMs, address, description: descr};
|
return {timestampMs: post.timestampMs, address, description: descr};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user