Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add epochs to force count #603

Merged
merged 1 commit into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions components/Pages/Bonding/RewardsComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ const RewardsComponent = ({

const bondingHasStarted: boolean = useMemo(() => genesisStartTimeInNano / 1_000_000 < Date.now(),
[genesisStartTimeInNano])
const epochsToForce = Math.floor((Date.now() - (Number(currentEpoch?.epoch?.start_time ?? 0) / 1_000_000)) /
(1_000 * 3_600 * 24))
return (
<VStack
px={8}
Expand Down Expand Up @@ -309,15 +311,15 @@ const RewardsComponent = ({
bg="transparent"
borderRadius="full"
border="1px solid white"
width="50%"
width="55%"
variant="primary"
_hover={{
border: '1px solid #6ACA70',
color: '#6ACA70',
}}
onClick={() => forceEpochAndTakeSnapshots.submit()}
>
{'Force Epoch'}
{`Force Epoch (${epochsToForce})`}
</Button>
</Tooltip>
)}
Expand Down
4 changes: 2 additions & 2 deletions components/Pages/Dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ export const Dashboard: FC = () => {
const chains = useChainInfos()
const prices = usePrices()
useEffect(() => {
const fetchDashboardData = async () => {
const circulatingWhaleSupply = dashboardData.supply?.circulating / (10 ** 6) || 0
const fetchDashboardData = () => {
const circulatingWhaleSupply = (dashboardData.supply?.circulating ?? 0) / (10 ** 6)
const marketCap = circulatingWhaleSupply * (prices?.WHALE || 0) || 0
const mappedDashboardData = []
dashboardData.dashboardData?.map((data) => {
Expand Down
Loading