Merge pull request #949 from josepfo/fix/initial-wizard-breaks-upon-choosing-exchange
Fix: initial wizard breaks upon choosing exchange
This commit is contained in:
commit
bbde0fc2b6
6 changed files with 14 additions and 9 deletions
|
|
@ -41,7 +41,8 @@ const DenominationsSchema = Yup.object().shape({
|
|||
const getElements = (machines, locale = {}, classes) => {
|
||||
const fiatCurrency = R.prop('fiatCurrency')(locale)
|
||||
const maxNumberOfCassettes = Math.max(
|
||||
...R.map(it => it.numberOfCassettes, machines)
|
||||
...R.map(it => it.numberOfCassettes, machines),
|
||||
0
|
||||
)
|
||||
|
||||
const options = getBillOptions(locale, denominations)
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ const HeaderCell = withStyles({
|
|||
}
|
||||
})(TableCell)
|
||||
|
||||
const MachinesTable = ({ machines, numToRender }) => {
|
||||
const MachinesTable = ({ machines = [], numToRender }) => {
|
||||
const classes = useStyles()
|
||||
const history = useHistory()
|
||||
const getPercent = (notes, capacity = 500) => {
|
||||
|
|
@ -62,7 +62,8 @@ const MachinesTable = ({ machines, numToRender }) => {
|
|||
}
|
||||
|
||||
const maxNumberOfCassettes = Math.max(
|
||||
...R.map(it => it.numberOfCassettes, machines)
|
||||
...R.map(it => it.numberOfCassettes, machines),
|
||||
0
|
||||
)
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -160,7 +160,8 @@ const CashCassettes = () => {
|
|||
const locale = data?.config && fromNamespace('locale')(data.config)
|
||||
const fiatCurrency = locale?.fiatCurrency
|
||||
const maxNumberOfCassettes = Math.max(
|
||||
...R.map(it => it.numberOfCassettes, machines)
|
||||
...R.map(it => it.numberOfCassettes, machines),
|
||||
0
|
||||
)
|
||||
const cashboxCounts = R.reduce(
|
||||
(ret, m) => R.assoc(m.id, m.cashbox, ret),
|
||||
|
|
|
|||
|
|
@ -27,13 +27,14 @@ const FiatBalance = ({ section, min = 0, max = 100, fieldWidth = 80 }) => {
|
|||
setEditing,
|
||||
data,
|
||||
save,
|
||||
machines
|
||||
machines = []
|
||||
} = useContext(NotificationsCtx)
|
||||
const classes = useStyles()
|
||||
|
||||
const maxNumberOfCassettes =
|
||||
Math.max(...R.map(it => it.numberOfCassettes, machines)) ??
|
||||
const maxNumberOfCassettes = Math.max(
|
||||
...R.map(it => it.numberOfCassettes, machines),
|
||||
DEFAULT_NUMBER_OF_CASSETTES
|
||||
)
|
||||
|
||||
const editing = isEditing(NAME)
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,8 @@ const FiatBalanceOverrides = ({ section }) => {
|
|||
}
|
||||
|
||||
const maxNumberOfCassettes = Math.max(
|
||||
...R.map(it => it.numberOfCassettes, machines)
|
||||
...R.map(it => it.numberOfCassettes, machines),
|
||||
0
|
||||
)
|
||||
|
||||
const percentMin = 0
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ const SAVE_ACCOUNTS = gql`
|
|||
}
|
||||
`
|
||||
|
||||
const isConfigurable = it => !R.contains(it)(['mock-exchange'])
|
||||
const isConfigurable = it => !R.isNil(it) && !R.contains(it)(['mock-exchange'])
|
||||
|
||||
const ChooseExchange = ({ data: currentData, addData }) => {
|
||||
const classes = useStyles()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue