Skip to content

Commit

Permalink
call getCurrencyListForSections only if we have a searchValue
Browse files Browse the repository at this point in the history
  • Loading branch information
s77rt committed Dec 5, 2022
1 parent 2b85c51 commit 2428eb4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pages/iou/IOUCurrencySelection.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class IOUCurrencySelection extends Component {
constructor(props) {
super(props);

const {currencyOptions} = OptionsListUtils.getCurrencyListForSections(this.getCurrencyOptions(this.props.currencyList), '');
const {currencyOptions} = this.getCurrencyOptions(this.props.currencyList);

this.state = {
searchValue: '',
Expand Down Expand Up @@ -90,10 +90,10 @@ class IOUCurrencySelection extends Component {
* @return {void}
*/
changeSearchValue(searchValue) {
const {currencyOptions} = OptionsListUtils.getCurrencyListForSections(
const {currencyOptions} = searchValue ? OptionsListUtils.getCurrencyListForSections(
this.getCurrencyOptions(this.props.currencyList),
searchValue,
);
) : this.getCurrencyOptions(this.props.currencyList);
this.setState({
searchValue,
currencyData: currencyOptions,
Expand Down

0 comments on commit 2428eb4

Please sign in to comment.