Skip to content

Commit

Permalink
Remove duplicated refresh funcs from average win/loss
Browse files Browse the repository at this point in the history
  • Loading branch information
alexstotsky committed Aug 21, 2024
1 parent 1452360 commit d1962a7
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions src/components/AverageWinLoss/AverageWinLoss.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import { Card, Elevation } from '@blueprintjs/core'
import _sortBy from 'lodash/sortBy'
import { isEmpty, isEqual } from '@bitfinex/lib-js-util-base'
import { isEmpty } from '@bitfinex/lib-js-util-base'

import {
SectionHeader,
Expand All @@ -15,7 +15,6 @@ import NoData from 'ui/NoData'
import Loading from 'ui/Loading'
import Chart from 'ui/Charts/Chart'
import TimeRange from 'ui/TimeRange'
import QueryButton from 'ui/QueryButton'
import RefreshButton from 'ui/RefreshButton'
import SectionSwitch from 'ui/SectionSwitch'
import TimeFrameSelector from 'ui/TimeFrameSelector'
Expand Down Expand Up @@ -75,7 +74,6 @@ class AverageWinLoss extends PureComponent {
mts: PropTypes.number,
USD: PropTypes.number,
})),
fetchData: PropTypes.func.isRequired,
pageLoading: PropTypes.bool.isRequired,
params: PropTypes.shape({
timeframe: PropTypes.string,
Expand Down Expand Up @@ -103,11 +101,6 @@ class AverageWinLoss extends PureComponent {
checkFetch(prevProps, this.props, TYPE)
}

handleQuery = () => {
const { fetchData } = this.props
fetchData()
}

handleTimeframeChange = (timeframe) => {
const { setParams } = this.props
setParams({ timeframe })
Expand All @@ -125,11 +118,6 @@ class AverageWinLoss extends PureComponent {
setParams(params)
}

hasChanges = () => {
const { currentFetchParams, params } = this.props
return !isEqual(currentFetchParams, params)
}

render() {
const {
t,
Expand Down Expand Up @@ -210,10 +198,6 @@ class AverageWinLoss extends PureComponent {
onChange={this.handleReportTypeChange}
/>
</SectionHeaderItem>
<QueryButton
onClick={this.handleQuery}
disabled={!this.hasChanges()}
/>
<RefreshButton onClick={refresh} />
</SectionHeaderRow>
</SectionHeader>
Expand Down

0 comments on commit d1962a7

Please sign in to comment.