fix: add loading flag to commission list
This commit is contained in:
parent
070e9155a7
commit
49ea028805
2 changed files with 4 additions and 4 deletions
|
|
@ -49,7 +49,7 @@ const Commissions = ({ name: SCREEN_KEY }) => {
|
||||||
const classes = useStyles()
|
const classes = useStyles()
|
||||||
const [showMachines, setShowMachines] = useState(false)
|
const [showMachines, setShowMachines] = useState(false)
|
||||||
const [error, setError] = useState(null)
|
const [error, setError] = useState(null)
|
||||||
const { data } = useQuery(GET_DATA)
|
const { data, loading } = useQuery(GET_DATA)
|
||||||
const [saveConfig] = useMutation(SAVE_CONFIG, {
|
const [saveConfig] = useMutation(SAVE_CONFIG, {
|
||||||
refetchQueries: () => ['getData'],
|
refetchQueries: () => ['getData'],
|
||||||
onError: error => setError(error)
|
onError: error => setError(error)
|
||||||
|
|
@ -118,7 +118,7 @@ const Commissions = ({ name: SCREEN_KEY }) => {
|
||||||
iconClassName={classes.listViewButton}
|
iconClassName={classes.listViewButton}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{!showMachines && (
|
{!showMachines && !loading && (
|
||||||
<CommissionsDetails
|
<CommissionsDetails
|
||||||
config={config}
|
config={config}
|
||||||
locale={localeConfig}
|
locale={localeConfig}
|
||||||
|
|
@ -130,7 +130,7 @@ const Commissions = ({ name: SCREEN_KEY }) => {
|
||||||
classes={classes}
|
classes={classes}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{showMachines && (
|
{showMachines && !loading && (
|
||||||
<CommissionsList
|
<CommissionsList
|
||||||
config={config}
|
config={config}
|
||||||
localeConfig={localeConfig}
|
localeConfig={localeConfig}
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ const CommissionsList = memo(
|
||||||
const [coinFilter, setCoinFilter] = useState(SHOW_ALL)
|
const [coinFilter, setCoinFilter] = useState(SHOW_ALL)
|
||||||
const [orderProp, setOrderProp] = useState(ORDER_OPTIONS[0])
|
const [orderProp, setOrderProp] = useState(ORDER_OPTIONS[0])
|
||||||
|
|
||||||
const coins = R.prop('cryptoCurrencies', localeConfig)
|
const coins = R.prop('cryptoCurrencies', localeConfig) ?? []
|
||||||
|
|
||||||
const getMachineCoins = deviceId => {
|
const getMachineCoins = deviceId => {
|
||||||
const override = R.prop('overrides', localeConfig)?.find(
|
const override = R.prop('overrides', localeConfig)?.find(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue