Skip to content

Commit

Permalink
Fix join/leave messages not showing (#8396) (#8397)
Browse files Browse the repository at this point in the history
(cherry picked from commit d996ed8)

Co-authored-by: Daniel Espino García <[email protected]>
  • Loading branch information
mattermost-build and larkox authored Dec 6, 2024
1 parent 3be3a15 commit fc87d16
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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]}`;
}

Expand Down
4 changes: 2 additions & 2 deletions app/utils/post_list/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ export function shouldFilterJoinLeavePost(post: PostModel, showJoinLeave: boolea
}

export type MessageData = {
actorId: string;
actorId?: string;
postType: string;
userIds: string[];
}
Expand All @@ -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;
}

Expand Down

0 comments on commit fc87d16

Please sign in to comment.