Fix join/leave messages not showing (#8396)

This commit is contained in:
Daniel Espino García 2024-12-06 00:46:15 +01:00 committed by GitHub
parent 8b9779d4b3
commit d996ed8133
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;
}