mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Fix duplicate keys in CombinedSystemMessage component (#23507)
This commit is contained in:
parent
fa1ba4717b
commit
eaa190acf6
@ -322,14 +322,15 @@ export class CombinedSystemMessage extends React.PureComponent<Props> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderMessage(postType: string, userIds: string[], actorId?: string): JSX.Element {
|
renderMessage(index: number, postType: string, userIds: string[], actorId?: string): JSX.Element {
|
||||||
return (
|
return (
|
||||||
<React.Fragment key={postType + actorId}>
|
<React.Fragment key={index}>
|
||||||
{this.renderFormattedMessage(postType, userIds, actorId)}
|
{this.renderFormattedMessage(postType, userIds, actorId)}
|
||||||
<br/>
|
<br/>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
render(): JSX.Element {
|
render(): JSX.Element {
|
||||||
const {
|
const {
|
||||||
currentUserId,
|
currentUserId,
|
||||||
@ -337,7 +338,8 @@ export class CombinedSystemMessage extends React.PureComponent<Props> {
|
|||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
const content = [];
|
const content = [];
|
||||||
for (const message of messageData) {
|
for (let i = 0; i < messageData.length; i++) {
|
||||||
|
const message = messageData[i];
|
||||||
const {
|
const {
|
||||||
postType,
|
postType,
|
||||||
actorId,
|
actorId,
|
||||||
@ -356,7 +358,7 @@ export class CombinedSystemMessage extends React.PureComponent<Props> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
content.push(this.renderMessage(postType, userIds, actorId));
|
content.push(this.renderMessage(i, postType, userIds, actorId));
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
Reference in New Issue
Block a user