Fix join/leave messages not showing (#8396) (#8397)

(cherry picked from commit d996ed8133)

Co-authored-by: Daniel Espino García <larkox@gmail.com>
This commit is contained in:
Mattermost Build 2024-12-06 07:50:56 +01:00 committed by GitHub
parent 3be3a15976
commit fc87d16578
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -116,12 +116,12 @@ const CombinedUserActivity = ({
}
}, [post, canDelete, isTablet, intl, location]);
const renderMessage = (postType: string, userIds: string[], actorId: string) => {
const renderMessage = (postType: string, userIds: string[], actorId?: string) => {
if (!post) {
return null;
}
let actor = '';
if (secureGetFromRecord(usernamesById, actorId)) {
if (actorId && secureGetFromRecord(usernamesById, actorId)) {
actor = `@${usernamesById[actorId]}`;
}

View file

@ -389,7 +389,7 @@ export function shouldFilterJoinLeavePost(post: PostModel, showJoinLeave: boolea
}
export type MessageData = {
actorId: string;
actorId?: string;
postType: string;
userIds: string[];
}
@ -399,7 +399,7 @@ function isMessageData(v: unknown): v is MessageData {
return false;
}
if (!('actorId' in v) || typeof v.actorId !== 'string') {
if (('actorId' in v) && typeof v.actorId !== 'string') {
return false;
}