Skip to content

Commit

Permalink
fix: timeline time
Browse files Browse the repository at this point in the history
  • Loading branch information
Argeare5 committed Jan 6, 2024
1 parent fb0d88c commit cce00a1
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions src/proposals/components/proposal/ProposalPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,15 @@ export function ProposalPage({

const now = dayjs().unix();

const openToVoteTimestamp =
proposal.data.votingMachineData.startTime > 0
? proposal.data.votingMachineData.startTime
: now >
proposal.data.creationTime + proposal.config.coolDownBeforeVotingStart
? now + 60
: proposal.data.creationTime +
proposal.config.coolDownBeforeVotingStart;

const votingClosedTimestamp =
proposal.data.votingMachineData.votingClosedAndSentTimestamp > 0
? proposal.data.votingMachineData.votingClosedAndSentTimestamp
Expand All @@ -213,9 +222,7 @@ export function ProposalPage({
: proposal.data.votingMachineData.endTime > 0 &&
now > proposal.data.votingMachineData.endTime
? now + 60
: now +
proposal.config.coolDownBeforeVotingStart +
proposal.timings.cooldownPeriod;
: openToVoteTimestamp + proposal.data.votingDuration;

const payloadsExecutedTimestamp =
lastPayloadExecutedAt > 0
Expand Down Expand Up @@ -249,9 +256,8 @@ export function ProposalPage({
lastPayloadExecutedAt <= 0
? proposal.data.votingMachineData.endTime +
proposal.timings.executionPayloadTime
: now +
proposal.config.coolDownBeforeVotingStart +
proposal.timings.cooldownPeriod +
: openToVoteTimestamp +
proposal.data.votingDuration +
proposal.timings.executionPayloadTime;

const Timeline = () => {
Expand All @@ -273,16 +279,7 @@ export function ProposalPage({
}
votingStartTime={proposal.data.votingMachineData.startTime}
createdTimestamp={proposal.data.creationTime}
openToVoteTimestamp={
proposal.data.votingMachineData.startTime > 0
? proposal.data.votingMachineData.startTime
: now >
proposal.data.creationTime +
proposal.config.coolDownBeforeVotingStart
? now + 60
: proposal.data.creationTime +
proposal.config.coolDownBeforeVotingStart
}
openToVoteTimestamp={openToVoteTimestamp}
votingClosedTimestamp={votingClosedTimestamp}
payloadsExecutedTimestamp={payloadsExecutedTimestamp}
finishedTimestamp={payloadsExecutedTimestamp}
Expand Down

1 comment on commit cce00a1

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit was deployed on ipfs

Please sign in to comment.