{typeof channel?.last_message?.content === "string" &&
- alert ? (
- channel.last_message.content.slice(0, 32)
+ alert ? (
+ convertMentionsToUsernames(channel.last_message.content, client).slice(0, 32)
) : (
)}
@@ -140,6 +152,8 @@ export const ChannelButton = observer((props: ChannelProps) => {
...divProps
} = props;
+ const client = useClient();
+
if (channel.channel_type === "SavedMessages") throw "Invalid channel type.";
if (channel.channel_type === "DirectMessage") {
if (typeof user === "undefined") throw "No user provided.";
@@ -170,9 +184,9 @@ export const ChannelButton = observer((props: ChannelProps) => {
{channel.channel_type === "Group" && (
{typeof channel.last_message?.content === "string" &&
- alert &&
- !muted ? (
- channel.last_message.content.slice(0, 32)
+ alert &&
+ !muted ? (
+ convertMentionsToUsernames(channel.last_message.content, client).slice(0, 32)
) : (