Fix typing in m.mentions finder

This commit is contained in:
nexy7574 2025-01-05 18:48:48 +00:00
parent a51538dd81
commit c67ecc2fb9

View file

@ -301,10 +301,10 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>(
}
let mentionsRoom = false;
editor.children.forEach((node: Descendant): void => {
if(node.type === undefined || node.type !== "paragraph") return;
if("type" in node && node.type !== "paragraph") return;
const paragraph: ParagraphElement = node as ParagraphElement;
paragraph.children?.forEach((child: InlineElement): void => {
if (child.type === "mention") {
if ("type" in child && child.type === "mention") {
const mention: MentionElement = child as MentionElement;
if (mention.name === "@room" && !mention.id.startsWith("@")) {
mentionsRoom = true