Request History: Set dropdown value to the response instead of null (#2735)

Co-authored-by: Timothy Lim <tim.lim@intercom.io>
Co-authored-by: Opender Singh <opender.singh@konghq.com>
This commit is contained in:
Timothy Lim 2021-08-31 14:21:02 +08:00 committed by GitHub
parent c8926d75ae
commit 84fc8f38a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,7 +55,7 @@ class ResponseHistoryDropdown extends PureComponent<Props> {
}); });
} }
renderDropdownItem(response: Response, i: number) { renderDropdownItem(response: Response) {
const { activeResponse, requestVersions } = this.props; const { activeResponse, requestVersions } = this.props;
const activeResponseId = activeResponse ? activeResponse._id : 'n/a'; const activeResponseId = activeResponse ? activeResponse._id : 'n/a';
const active = response._id === activeResponseId; const active = response._id === activeResponseId;
@ -68,7 +68,7 @@ class ResponseHistoryDropdown extends PureComponent<Props> {
<DropdownItem <DropdownItem
key={response._id} key={response._id}
disabled={active} disabled={active}
value={i === 0 ? null : response} value={response}
onClick={this._handleSetActiveResponse} onClick={this._handleSetActiveResponse}
> >
{active ? <i className="fa fa-thumb-tack" /> : <i className="fa fa-empty" />}{' '} {active ? <i className="fa fa-thumb-tack" /> : <i className="fa fa-empty" />}{' '}