mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-09 10:15:26 +00:00
Fix message links redirecting to home page.
This commit is contained in:
@@ -171,15 +171,19 @@ export const MessageReply = observer(({ index, channel, id }: Props) => {
|
|||||||
<div
|
<div
|
||||||
className="content"
|
className="content"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
const channel = message.channel!;
|
||||||
if (
|
if (
|
||||||
channel.channel_type === "TextChannel"
|
channel.channel_type === "TextChannel"
|
||||||
) {
|
) {
|
||||||
|
console.log(
|
||||||
|
`/server/${channel.server_id}/channel/${channel._id}/${message._id}`,
|
||||||
|
);
|
||||||
history.push(
|
history.push(
|
||||||
`/server/${channel.server_id}/channel/${channel._id}/${message._id}`,
|
`/server/${channel.server_id}/channel/${channel._id}/${message._id}`,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
history.push(
|
history.push(
|
||||||
`/channel/${channel}/${message._id}`,
|
`/channel/${channel._id}/${message._id}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}}>
|
}}>
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ export function MessageArea({ id }: Props) {
|
|||||||
|
|
||||||
const channel = client.channels.get(id);
|
const channel = client.channels.get(id);
|
||||||
if (channel?.channel_type === "TextChannel") {
|
if (channel?.channel_type === "TextChannel") {
|
||||||
history.push(`/server/${channel.server}/channel/${id}`);
|
history.push(`/server/${channel.server_id}/channel/${id}`);
|
||||||
} else {
|
} else {
|
||||||
history.push(`/channel/${id}`);
|
history.push(`/channel/${id}`);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user