From baaa6bdb5c65ebd66eaf29bc92be1699402c72b5 Mon Sep 17 00:00:00 2001 From: meriadec Date: Mon, 11 Jun 2018 17:47:56 +0200 Subject: [PATCH] Fix when removing selected currency in select --- .../ImportAccounts/steps/01-step-choose-currency.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/components/modals/ImportAccounts/steps/01-step-choose-currency.js b/src/components/modals/ImportAccounts/steps/01-step-choose-currency.js index 27f6136e..8e8f1bdd 100644 --- a/src/components/modals/ImportAccounts/steps/01-step-choose-currency.js +++ b/src/components/modals/ImportAccounts/steps/01-step-choose-currency.js @@ -1,6 +1,7 @@ // @flow import React, { Fragment } from 'react' +import isArray from 'lodash/isArray' import SelectCurrency from 'components/SelectCurrency' import Button from 'components/base/Button' @@ -9,7 +10,16 @@ import CurrencyBadge from 'components/base/CurrencyBadge' import type { StepProps } from '../index' function StepChooseCurrency({ currency, setState }: StepProps) { - return setState({ currency })} value={currency} /> + return ( + { + setState({ + currency: isArray(currency) && currency.length === 0 ? null : currency, + }) + }} + value={currency} + /> + ) } export function StepChooseCurrencyFooter({ transitionTo, currency, t }: StepProps) {