Closed tyagishuchi1 closed 4 years ago
@ashishjur Adding a comment here to keep track of our discussion. We have decided to use a config variable REWARD_DELAY_IN_SECONDS
to switch between values 420
(7 minutes for test) 604800
(7 days for prod)
Making a note here that the implementation is correct. It uses 7 days.
Although for testing purposes requirement is 7 min (or some other value). Hence I'll refactor it to use the env variable as discussed on the call.
Variable name: REACT_APP_REWARD_DELAY_IN_SECONDS
Default value: 604800
Once a slot has passed
due date + 7 days
requirement, the slot does not show the 'Withdraw' button.Expected Behavior
The slot should show the option to
Withdraw
if the current state isCompleted
and current time > due date + 7 days.Current Behavior
It just shows
Completed
state. The state for the slot in the database also remainsCompleted
.Possible Solution
On the frontend, use one of the two flows:
Completed
for a slot, use the contract's read-only methodcanWithdraw
to check if a slot is eligible for withdrawing.Completed
for a slot, implement the logic for calculating if 7 days have passed since the due date.Steps to Reproduce
Environment: Temp