mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-26 17:10:57 -05:00
fix: don't fail if channel is null on reply
This commit is contained in:
parent
b955f2820c
commit
318177b414
2 changed files with 4 additions and 2 deletions
|
@ -96,7 +96,7 @@ const Message = observer(
|
||||||
key={message_id}
|
key={message_id}
|
||||||
index={index}
|
index={index}
|
||||||
id={message_id}
|
id={message_id}
|
||||||
channel={message.channel!}
|
channel={message.channel}
|
||||||
parent_mentions={message.mention_ids ?? []}
|
parent_mentions={message.mention_ids ?? []}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
|
|
|
@ -18,7 +18,7 @@ import { SystemMessage } from "../SystemMessage";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
parent_mentions: string[];
|
parent_mentions: string[];
|
||||||
channel: Channel;
|
channel?: Channel;
|
||||||
index: number;
|
index: number;
|
||||||
id: string;
|
id: string;
|
||||||
}
|
}
|
||||||
|
@ -148,6 +148,8 @@ export const ReplyBase = styled.div<{
|
||||||
|
|
||||||
export const MessageReply = observer(
|
export const MessageReply = observer(
|
||||||
({ index, channel, id, parent_mentions }: Props) => {
|
({ index, channel, id, parent_mentions }: Props) => {
|
||||||
|
if (!channel) return null;
|
||||||
|
|
||||||
const view = getRenderer(channel);
|
const view = getRenderer(channel);
|
||||||
if (view.state !== "RENDER") return null;
|
if (view.state !== "RENDER") return null;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue