Skip to content

Commit

Permalink
fix: 🐛 fix killed gaguges
Browse files Browse the repository at this point in the history
  • Loading branch information
chef-ryan committed Feb 14, 2025
1 parent 2b1e619 commit 41f0793
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions apps/web/src/views/GaugesVoting/hooks/useUserVote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,18 +197,23 @@ export const useUserVote = (gauge: Gauge | undefined, submitted?: boolean, usePr
})
: []
const [[nativeSlope, nativePower, nativeEnd], lastVoteTime] = response
const voteLocked = Boolean(lastVoteTime)
let voteLocked = dayjs.unix(Number(lastVoteTime)).add(10, 'day').isAfter(dayjs.unix(currentTimestamp))
let votedPower = nativePower
if (gauge?.killed) {
voteLocked = true
votedPower = 0n
}

return {
hash: gauge?.hash as Hex,
nativeSlope,
nativePower,
nativePower: votedPower,
nativeEnd,
nativeLastVoteTime: lastVoteTime,
nativeVoteLocked: voteLocked,

slope: nativeSlope,
power: nativePower,
power: votedPower,
end: nativeEnd,
lastVoteTime,
voteLocked,
Expand Down

0 comments on commit 41f0793

Please sign in to comment.