diff --git a/src/v2/components/TourDeSol/Cards/index.jsx b/src/v2/components/TourDeSol/Cards/index.jsx index 78e0efc9..d5c6e5ba 100644 --- a/src/v2/components/TourDeSol/Cards/index.jsx +++ b/src/v2/components/TourDeSol/Cards/index.jsx @@ -17,7 +17,7 @@ const Cards = ({ }) => { const classes = useStyles(); const { - validators, + activeValidators, inactiveValidators, supply, totalStaked, @@ -77,7 +77,7 @@ const Cards = ({ }, { title: 'Active Validators', - value: validators.length, + value: activeValidators.length, changes: '', period: 'since yesterday', helpText: diff --git a/src/v2/components/TourDeSol/Table/index.jsx b/src/v2/components/TourDeSol/Table/index.jsx index ab9a9890..0fedc440 100644 --- a/src/v2/components/TourDeSol/Table/index.jsx +++ b/src/v2/components/TourDeSol/Table/index.jsx @@ -28,7 +28,7 @@ const ValidatorsTable = ({separate}: {separate: boolean}) => { const classes = useStyles(); const theme = useTheme(); const showTable = useMediaQuery(theme.breakpoints.up('md')); - const {validators} = NodesStore; + const {activeValidators} = NodesStore; const renderRow = row => { const uptime = getUptime(row); @@ -82,7 +82,7 @@ const ValidatorsTable = ({separate}: {separate: boolean}) => { term="" /> - {validators.length} + {activeValidators.length} {!separate && ( See all > @@ -104,12 +104,12 @@ const ValidatorsTable = ({separate}: {separate: boolean}) => { root: classes.body, }} > - {map(renderRow)(validators)} + {map(renderRow)(activeValidators)} ) : (
- {map(renderCard)(validators)} + {map(renderCard)(activeValidators)}
)} diff --git a/src/v2/components/Validators/All/index.jsx b/src/v2/components/Validators/All/index.jsx index 131408dd..4868e919 100644 --- a/src/v2/components/Validators/All/index.jsx +++ b/src/v2/components/Validators/All/index.jsx @@ -8,13 +8,13 @@ import ValidatorsTable from '../Table'; import useStyles from './styles'; const ValidatorsAll = () => { - const {validators, inactiveValidators} = NodesStore; + const {activeValidators, inactiveValidators} = NodesStore; const classes = useStyles(); return (
- {validators.length + inactiveValidators.length} + {activeValidators.length + inactiveValidators.length}
diff --git a/src/v2/components/Validators/Table/index.jsx b/src/v2/components/Validators/Table/index.jsx index 1f2c2a17..07d2b1e1 100644 --- a/src/v2/components/Validators/Table/index.jsx +++ b/src/v2/components/Validators/Table/index.jsx @@ -27,7 +27,7 @@ const ValidatorsTable = ({separate}: {separate: boolean}) => { const classes = useStyles(); const theme = useTheme(); const showTable = useMediaQuery(theme.breakpoints.up('md')); - const {validators, inactiveValidators} = NodesStore; + const {activeValidators, inactiveValidators} = NodesStore; const renderRow = row => { const uptime = row.uptime && getUptime(row); const {identity = {}, nodePubkey, activatedStake, commission} = row; @@ -88,7 +88,7 @@ const ValidatorsTable = ({separate}: {separate: boolean}) => {
Validators - {validators.length + inactiveValidators.length} + {activeValidators.length + inactiveValidators.length} @@ -111,13 +111,13 @@ const ValidatorsTable = ({separate}: {separate: boolean}) => { root: classes.body, }} > - {map(renderRow)(validators)} + {map(renderRow)(activeValidators)} {map(renderRow)(inactiveValidators)} ) : (
- {map(renderCard)(validators)} + {map(renderCard)(activeValidators)} {map(renderCard)(inactiveValidators)}
)} diff --git a/src/v2/stores/nodes.js b/src/v2/stores/nodes.js index 09408197..7cc14d75 100644 --- a/src/v2/stores/nodes.js +++ b/src/v2/stores/nodes.js @@ -54,6 +54,10 @@ class Store { } get validators() { + return filter(node => node.what === 'Validator')(this.network); + } + + get activeValidators() { return filter(node => node.what === 'Validator' && node.activatedStake)( this.network, ); @@ -73,6 +77,7 @@ decorate(Store, { updateClusterInfo: action.bound, mapMarkers: computed, validators: computed, + activeValidators: computed, inactiveValidators: computed, fetchClusterInfo: action.bound, });