Fixed editing non first index submissions.

The idSuffix was not being set properly and was set to undefined.
This commit is contained in:
Ajay Ramachandran
2020-04-09 12:54:04 -04:00
parent 80fe28a952
commit e2128f7ae3
2 changed files with 3 additions and 3 deletions

View File

@@ -34,7 +34,7 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
this.categoryOptionRef = React.createRef(); this.categoryOptionRef = React.createRef();
this.idSuffix = this.idSuffix; this.idSuffix = this.props.idSuffix;
this.state = { this.state = {
editing: false, editing: false,

View File

@@ -100,7 +100,7 @@ class SubmissionNoticeComponent extends React.Component<SubmissionNoticeProps, S
elements.push( elements.push(
<SponsorTimeEditComponent key={i} <SponsorTimeEditComponent key={i}
idSuffix={this.state.idSuffix} idSuffix={this.state.idSuffix + i}
index={i} index={i}
contentContainer={this.props.contentContainer} contentContainer={this.props.contentContainer}
submissionNotice={this} submissionNotice={this}
@@ -119,7 +119,7 @@ class SubmissionNoticeComponent extends React.Component<SubmissionNoticeProps, S
for (let i = 0; i < this.state.messages.length; i++) { for (let i = 0; i < this.state.messages.length; i++) {
elements.push( elements.push(
<NoticeTextSelectionComponent idSuffix={this.state.idSuffix} <NoticeTextSelectionComponent idSuffix={this.state.idSuffix + i}
text={this.state.messages[i]} text={this.state.messages[i]}
key={i}> key={i}>
</NoticeTextSelectionComponent> </NoticeTextSelectionComponent>