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 getElements = (machines, locale = {}, classes) => {
|
||||||
const fiatCurrency = R.prop('fiatCurrency')(locale)
|
const fiatCurrency = R.prop('fiatCurrency')(locale)
|
||||||
const maxNumberOfCassettes = Math.max(
|
const maxNumberOfCassettes = Math.max(
|
||||||
...R.map(it => it.numberOfCassettes, machines)
|
...R.map(it => it.numberOfCassettes, machines),
|
||||||
|
0
|
||||||
)
|
)
|
||||||
|
|
||||||
const options = getBillOptions(locale, denominations)
|
const options = getBillOptions(locale, denominations)
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ const HeaderCell = withStyles({
|
||||||
}
|
}
|
||||||
})(TableCell)
|
})(TableCell)
|
||||||
|
|
||||||
const MachinesTable = ({ machines, numToRender }) => {
|
const MachinesTable = ({ machines = [], numToRender }) => {
|
||||||
const classes = useStyles()
|
const classes = useStyles()
|
||||||
const history = useHistory()
|
const history = useHistory()
|
||||||
const getPercent = (notes, capacity = 500) => {
|
const getPercent = (notes, capacity = 500) => {
|
||||||
|
|
@ -62,7 +62,8 @@ const MachinesTable = ({ machines, numToRender }) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const maxNumberOfCassettes = Math.max(
|
const maxNumberOfCassettes = Math.max(
|
||||||
...R.map(it => it.numberOfCassettes, machines)
|
...R.map(it => it.numberOfCassettes, machines),
|
||||||
|
0
|
||||||
)
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -160,7 +160,8 @@ const CashCassettes = () => {
|
||||||
const locale = data?.config && fromNamespace('locale')(data.config)
|
const locale = data?.config && fromNamespace('locale')(data.config)
|
||||||
const fiatCurrency = locale?.fiatCurrency
|
const fiatCurrency = locale?.fiatCurrency
|
||||||
const maxNumberOfCassettes = Math.max(
|
const maxNumberOfCassettes = Math.max(
|
||||||
...R.map(it => it.numberOfCassettes, machines)
|
...R.map(it => it.numberOfCassettes, machines),
|
||||||
|
0
|
||||||
)
|
)
|
||||||
const cashboxCounts = R.reduce(
|
const cashboxCounts = R.reduce(
|
||||||
(ret, m) => R.assoc(m.id, m.cashbox, ret),
|
(ret, m) => R.assoc(m.id, m.cashbox, ret),
|
||||||
|
|
|
||||||
|
|
@ -27,13 +27,14 @@ const FiatBalance = ({ section, min = 0, max = 100, fieldWidth = 80 }) => {
|
||||||
setEditing,
|
setEditing,
|
||||||
data,
|
data,
|
||||||
save,
|
save,
|
||||||
machines
|
machines = []
|
||||||
} = useContext(NotificationsCtx)
|
} = useContext(NotificationsCtx)
|
||||||
const classes = useStyles()
|
const classes = useStyles()
|
||||||
|
|
||||||
const maxNumberOfCassettes =
|
const maxNumberOfCassettes = Math.max(
|
||||||
Math.max(...R.map(it => it.numberOfCassettes, machines)) ??
|
...R.map(it => it.numberOfCassettes, machines),
|
||||||
DEFAULT_NUMBER_OF_CASSETTES
|
DEFAULT_NUMBER_OF_CASSETTES
|
||||||
|
)
|
||||||
|
|
||||||
const editing = isEditing(NAME)
|
const editing = isEditing(NAME)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,8 @@ const FiatBalanceOverrides = ({ section }) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const maxNumberOfCassettes = Math.max(
|
const maxNumberOfCassettes = Math.max(
|
||||||
...R.map(it => it.numberOfCassettes, machines)
|
...R.map(it => it.numberOfCassettes, machines),
|
||||||
|
0
|
||||||
)
|
)
|
||||||
|
|
||||||
const percentMin = 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 ChooseExchange = ({ data: currentData, addData }) => {
|
||||||
const classes = useStyles()
|
const classes = useStyles()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue