From 909985b47d8cd25207eb299d5991915898335896 Mon Sep 17 00:00:00 2001 From: Paul Date: Sat, 31 Jul 2021 15:11:58 +0100 Subject: [PATCH] Fix message links redirecting to home page. --- .../common/messaging/attachments/MessageReply.tsx | 6 +++++- src/pages/channels/messaging/MessageArea.tsx | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/common/messaging/attachments/MessageReply.tsx b/src/components/common/messaging/attachments/MessageReply.tsx index 1c2e29a8..7e606a65 100644 --- a/src/components/common/messaging/attachments/MessageReply.tsx +++ b/src/components/common/messaging/attachments/MessageReply.tsx @@ -171,15 +171,19 @@ export const MessageReply = observer(({ index, channel, id }: Props) => {
{ + const channel = message.channel!; if ( channel.channel_type === "TextChannel" ) { + console.log( + `/server/${channel.server_id}/channel/${channel._id}/${message._id}`, + ); history.push( `/server/${channel.server_id}/channel/${channel._id}/${message._id}`, ); } else { history.push( - `/channel/${channel}/${message._id}`, + `/channel/${channel._id}/${message._id}`, ); } }}> diff --git a/src/pages/channels/messaging/MessageArea.tsx b/src/pages/channels/messaging/MessageArea.tsx index 43fffded..3fbc10bc 100644 --- a/src/pages/channels/messaging/MessageArea.tsx +++ b/src/pages/channels/messaging/MessageArea.tsx @@ -179,7 +179,7 @@ export function MessageArea({ id }: Props) { const channel = client.channels.get(id); if (channel?.channel_type === "TextChannel") { - history.push(`/server/${channel.server}/channel/${id}`); + history.push(`/server/${channel.server_id}/channel/${id}`); } else { history.push(`/channel/${id}`); }