mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-01-31 09:49:10 +01:00
Fix typing in m.mentions finder
This commit is contained in:
parent
a51538dd81
commit
c67ecc2fb9
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue