Skip to content

Commit

Permalink
fix: set pending status to proper PoET round
Browse files Browse the repository at this point in the history
  • Loading branch information
brusherru committed Jan 24, 2025
1 parent cc3d594 commit 3765c72
Showing 1 changed file with 21 additions and 28 deletions.
49 changes: 21 additions & 28 deletions src/hooks/useTimelineData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,37 +411,30 @@ const useTimelineData = () => {
}

// Mark next PoET round...
const curRound = getData(
`poet_round_${atEpoch}`
) as TimelineItem<PoetRoundDetails>;
const nextRound = getData(
`poet_round_${nextEpochNum}`
`poet_round_${atEpoch + 1}`
) as TimelineItem<PoetRoundDetails>;
if (nextRound) {
if (currentEpoch > nextEpochNum) {
// TODO: Mark as failed or success
// updated.push(
// timeLineItem(nextRound, {
// className: 'poet-round pending',
// identities: {
// [id]: {
// state: IdentityState.PENDING,
// details: 'Waiting for PoET registration window',
// },
// },
// })
// );
} else {
// Mark as pending
updated.push(
timeLineItem(nextRound, {
className: 'poet-round pending',
identities: {
[id]: {
state: IdentityState.PENDING,
details: 'Waiting for PoET registration window',
},
if (curRound && nextRound) {
const round =
Date.now() < new Date(curRound.start).getTime()
? curRound
: nextRound;
// TODO: Mark as failed or success
// Mark as pending
updated.push(
timeLineItem(round, {
className: 'poet-round pending',
identities: {
[id]: {
state: IdentityState.PENDING,
details: 'Waiting for PoET registration window',
},
})
);
}
},
})
);
}
}

Expand Down

0 comments on commit 3765c72

Please sign in to comment.