Skip to content

Commit

Permalink
Merge branch 'develop' into fix/disable-workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Jan 3, 2023
2 parents 6514703 + 18f41c8 commit 638302b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion apps/meteor/client/components/message/MessageContentBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ const MessageContentBody = ({ mentions, channels, md }: MessageContentBodyProps)
return undefined;
}

return mentions?.find(({ username }) => username === mention);
const filterUser = ({ username, type }: UserMention) => (!type || type === 'user') && username === mention;
const filterTeam = ({ name, type }: UserMention) => type === 'team' && name === mention;

return mentions?.find((mention) => filterUser(mention) || filterTeam(mention));
},
[mentions],
);
Expand Down
2 changes: 1 addition & 1 deletion packages/gazzodown/src/MarkupInteractionContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { IRoom, IUser } from '@rocket.chat/core-typings';
import type * as MessageParser from '@rocket.chat/message-parser';
import { createContext, FormEvent, UIEvent } from 'react';

export type UserMention = Pick<IUser, '_id' | 'username' | 'name'>;
export type UserMention = Pick<IUser, '_id' | 'username' | 'name' | 'type'>;
export type ChannelMention = Pick<IRoom, '_id' | 'name'>;

type MarkupInteractionContextValue = {
Expand Down
2 changes: 1 addition & 1 deletion packages/gazzodown/src/mentions/UserMentionElement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const UserMentionElement = ({ mention }: UserMentionElementProps): ReactElement
return (
<span
className={resolved._id === uid ? 'mention-link mention-link--me mention-link--user' : 'mention-link mention-link--user'}
title={resolved.username}
title={resolved.username || resolved.name}
onClick={handleClick}
data-uid={resolved._id}
>
Expand Down

0 comments on commit 638302b

Please sign in to comment.