filter values

This commit is contained in:
Jonathan Rainville 2018-08-31 15:29:26 -04:00 committed by Pascal Precht
parent d3c5407441
commit 486c839cd3
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D
1 changed files with 6 additions and 4 deletions

View File

@ -35,10 +35,12 @@ class GasStation extends Component {
if (!gasPrices.length) { if (!gasPrices.length) {
return []; return [];
} }
return gasPrices.map(gasPrice => { return gasPrices.filter((gasPrice) => {
return this.props.gasOracleStats[gasPrice].nbTxs >= 10; // Only keep prices with enough transactions
}).map(gasPrice => {
return { return {
gasPrice, gasPrice,
wait: this.props.gasOracleStats[gasPrice].averageWait wait: this.props.gasOracleStats[gasPrice].averageWait >= 0.1 ? this.props.gasOracleStats[gasPrice].averageWait : 0.1
}; };
}).sort((a, b) => { }).sort((a, b) => {
return a.gasPrice - b.gasPrice; return a.gasPrice - b.gasPrice;
@ -96,7 +98,7 @@ class GasStation extends Component {
<Grid.Row cards={true}> <Grid.Row cards={true}>
<Grid.Col lg={6} md={6} sm={12}> <Grid.Col lg={6} md={6} sm={12}>
<StampCard icon="sliders" color={GasStation.getColorForPrice(currentGasStep.gasPrice)}> <StampCard icon="sliders" color={GasStation.getColorForPrice(currentGasStep.gasPrice)}>
{currentGasStep.gasPrice / 1000000000} Wei {currentGasStep.gasPrice / 1000000000} GWei
</StampCard> </StampCard>
</Grid.Col> </Grid.Col>
<Grid.Col lg={6} md={6} sm={12}> <Grid.Col lg={6} md={6} sm={12}>
@ -119,7 +121,7 @@ class GasStation extends Component {
{/*<Grid.Row cards={true}> {/*<Grid.Row cards={true}>
<Grid.Col lg={4} md={6} sm={12}> <Grid.Col lg={4} md={6} sm={12}>
<StampCard icon="sliders" color="grey"> <StampCard icon="sliders" color="grey">
Average Price: {this.formattedGasStats.average.price} Wei Average Price: {this.formattedGasStats.average.price} GWei
</StampCard> </StampCard>
</Grid.Col> </Grid.Col>
<Grid.Col lg={4} md={6} sm={12}> <Grid.Col lg={4} md={6} sm={12}>