Updated StatusList keys and promotion implementation

• Updated:
- StatusList keys and promotion implementation
This commit is contained in:
mgabdev 2020-07-14 00:27:34 -05:00
parent 1c1bfabb17
commit 270a3dee15

View File

@ -260,11 +260,11 @@ class StatusList extends ImmutablePureComponent {
) )
} else { } else {
if (Array.isArray(promotions)) { if (Array.isArray(promotions)) {
const promotionBlock = promotions.find(p => p.position === i) const promotionBlock = promotions.find(p => (p.position === i && p.timeline_id === timelineId))
if (promotionBlock) { if (promotionBlock) {
scrollableContent.push( scrollableContent.push(
<StatusContainer <StatusContainer
key={promotionBlock.status_id} key={`promotion-${i}-${promotionBlock.status_id}`}
id={promotionBlock.status_id} id={promotionBlock.status_id}
onMoveUp={this.handleMoveUp} onMoveUp={this.handleMoveUp}
onMoveDown={this.handleMoveDown} onMoveDown={this.handleMoveDown}
@ -277,7 +277,7 @@ class StatusList extends ImmutablePureComponent {
} }
scrollableContent.push( scrollableContent.push(
<StatusContainer <StatusContainer
key={statusId} key={`${statusId}-${i}`}
id={statusId} id={statusId}
onMoveUp={this.handleMoveUp} onMoveUp={this.handleMoveUp}
onMoveDown={this.handleMoveDown} onMoveDown={this.handleMoveDown}