mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-31 10:31:35 +00:00
Fix exchange summary
This commit is contained in:
parent
6b8b694d07
commit
34caa7f800
@ -1,4 +1,4 @@
|
|||||||
import React, { useContext } from 'react';
|
import React, { useContext, useEffect, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@ -35,16 +35,25 @@ interface Props {
|
|||||||
const ExchangeDialog = ({ open = false, onClose }: Props): JSX.Element => {
|
const ExchangeDialog = ({ open = false, onClose }: Props): JSX.Element => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { federation } = useContext(FederationContext);
|
const { federation } = useContext(FederationContext);
|
||||||
|
const [loadingInfo, setLoadingInfo] = useState<boolean>(true);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (open) federation.loadInfo();
|
||||||
|
}, [open]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setLoadingInfo(federation.loading);
|
||||||
|
}, [federation.loading]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog open={open} onClose={onClose}>
|
<Dialog open={open} onClose={onClose}>
|
||||||
<div style={federation.loading ? {} : { display: 'none' }}>
|
|
||||||
<LinearProgress variant='indeterminate' />
|
|
||||||
</div>
|
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<Typography component='h5' variant='h5'>
|
<Typography component='h5' variant='h5'>
|
||||||
{t('Exchange Summary')}
|
{t('Exchange Summary')}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
<div style={loadingInfo ? {} : { display: 'none' }}>
|
||||||
|
<LinearProgress variant='indeterminate' />
|
||||||
|
</div>
|
||||||
|
|
||||||
<List dense>
|
<List dense>
|
||||||
<ListItem>
|
<ListItem>
|
||||||
|
@ -176,6 +176,9 @@ export class Federation {
|
|||||||
lifetime_volume: 0,
|
lifetime_volume: 0,
|
||||||
version: { major: 0, minor: 0, patch: 0 },
|
version: { major: 0, minor: 0, patch: 0 },
|
||||||
};
|
};
|
||||||
|
this.loading = true;
|
||||||
|
this.exchange.onlineCoordinators = 0;
|
||||||
|
this.exchange.loadingCoordinators = Object.keys(this.coordinators).length;
|
||||||
this.updateEnabledCoordinators();
|
this.updateEnabledCoordinators();
|
||||||
|
|
||||||
for (const coor of Object.values(this.coordinators)) {
|
for (const coor of Object.values(this.coordinators)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user