Skip to content

Commit

Permalink
fix double ## for room mentions
Browse files Browse the repository at this point in the history
  • Loading branch information
war-in committed Apr 12, 2024
1 parent 6d8c349 commit 55fc7f0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type MentionReportOnyxProps = {

type MentionReportRendererProps = MentionReportOnyxProps & CustomRendererProps<TText | TPhrasing>;

const removeLeadingLTRAndHash = (value: string) => value.replace(CONST.UNICODE.LTR, '').slice(1);
const removeLeadingLTRAndHash = (value: string) => value.replace(CONST.UNICODE.LTR, '').replace('#', '');

const getMentionDetails = (htmlAttributeReportID: string, currentReport: OnyxEntry<Report> | EmptyObject, reports: OnyxCollection<Report>, tnode: TText | TPhrasing) => {
let reportID: string | undefined;
Expand All @@ -38,7 +38,7 @@ const getMentionDetails = (htmlAttributeReportID: string, currentReport: OnyxEnt
const report = getReport(htmlAttributeReportID);

reportID = report?.reportID ?? undefined;
mentionDisplayText = report?.reportName ?? report?.displayName ?? htmlAttributeReportID;
mentionDisplayText = removeLeadingLTRAndHash(report?.reportName ?? report?.displayName ?? htmlAttributeReportID);
// get mention details from name inside tnode
} else if ('data' in tnode && !isEmptyObject(tnode.data)) {
mentionDisplayText = removeLeadingLTRAndHash(tnode.data);
Expand Down

0 comments on commit 55fc7f0

Please sign in to comment.