From 051eb8075cec50180d1c154bee8e1d58871257a7 Mon Sep 17 00:00:00 2001 From: Pavel Meyer Date: Mon, 11 Sep 2023 15:19:02 +0300 Subject: [PATCH] CW-Hotfix-mention Added getUserName util --- src/shared/ui-kit/TextEditor/utils/insertMention.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shared/ui-kit/TextEditor/utils/insertMention.ts b/src/shared/ui-kit/TextEditor/utils/insertMention.ts index fe19cbfa4b..dd1c52e6cc 100644 --- a/src/shared/ui-kit/TextEditor/utils/insertMention.ts +++ b/src/shared/ui-kit/TextEditor/utils/insertMention.ts @@ -1,12 +1,13 @@ import { Transforms } from "slate"; import { ReactEditor } from "slate-react"; +import { getUserName } from "@/shared/utils"; import { ElementType } from "../constants"; import { MentionElement } from "../types"; export const insertMention = (editor, character) => { const mention: MentionElement = { type: ElementType.Mention, - displayName: `${character?.displayName} `, + displayName: `${getUserName(character)} `, userId: character?.uid, children: [{ text: "" }], };