Skip to content

Commit 7a4eae6

Browse files
committed
fix jump urls in DMs
1 parent 1086876 commit 7a4eae6

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/components/messaging/Markdown.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,10 @@ function Anchor(props: JSX.HTMLAttributes<HTMLAnchorElement> & { isImage?: boole
9999
if (parsed && snowflakes.modelType(parsed) === snowflakes.ModelType.Message) {
100100
// If we're already in the same channel, just update the message ID
101101
if (pathParts[pathParts.length - 2] === params.channelId) {
102-
navigate(`/guilds/${params.guildId}/${params.channelId}/${messageId}`, { replace: true })
102+
const url = !!params.guildId
103+
? `/guilds/${params.guildId}/${params.channelId}/${messageId}`
104+
: `/dms/${params.channelId}/${messageId}`;
105+
navigate(url, { replace: true })
103106
} else {
104107
// Otherwise navigate to the full path
105108
navigate(url.pathname + url.search + url.hash)

0 commit comments

Comments
 (0)