Skip to content

Commit

Permalink
Remove empty period of '1Y' timeframe in Detail chart
Browse files Browse the repository at this point in the history
  • Loading branch information
alexharvest committed May 9, 2024
1 parent aaa79b7 commit d77e730
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/DetailChart/ApexChart/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ const ApexChart = ({
firstDate,
ago

if (range === 'ALL') {
if (range === 'ALL' || range === '1Y') {
if (filter === 0) {
firstDate =
data?.tvls?.length > 0
Expand All @@ -284,7 +284,11 @@ const ApexChart = ({
toDate = Math.floor(nowDate.getTime() / 1000),
periodDate = (toDate - Number(firstDate)) / (24 * 60 * 60)

ago = Math.ceil(periodDate)
if (range === '1Y' && periodDate > 365) {
ago = getRangeNumber(range)
} else {
ago = Math.ceil(periodDate)
}
} else {
ago = getRangeNumber(range)
}
Expand Down

0 comments on commit d77e730

Please sign in to comment.