mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-03-27 21:31:49 +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;
|
let mentionsRoom = false;
|
||||||
editor.children.forEach((node: Descendant): void => {
|
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;
|
const paragraph: ParagraphElement = node as ParagraphElement;
|
||||||
paragraph.children?.forEach((child: InlineElement): void => {
|
paragraph.children?.forEach((child: InlineElement): void => {
|
||||||
if (child.type === "mention") {
|
if ("type" in child && child.type === "mention") {
|
||||||
const mention: MentionElement = child as MentionElement;
|
const mention: MentionElement = child as MentionElement;
|
||||||
if (mention.name === "@room" && !mention.id.startsWith("@")) {
|
if (mention.name === "@room" && !mention.id.startsWith("@")) {
|
||||||
mentionsRoom = true
|
mentionsRoom = true
|
||||||
|
|
Loading…
Reference in a new issue