jurteam / platform

Jur Beta Platform
https://beta.jur.io
0 stars 0 forks source link

FIX Slot doesn't show the `Withdraw` button #244

Closed tyagishuchi1 closed 4 years ago

tyagishuchi1 commented 4 years ago

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 is Completed and current time > due date + 7 days.

Current Behavior

It just shows Completed state. The state for the slot in the database also remains Completed. image

Possible Solution

On the frontend, use one of the two flows:

  1. If the state is Completed for a slot, use the contract's read-only method canWithdraw to check if a slot is eligible for withdrawing.
  2. If the state is Completed for a slot, implement the logic for calculating if 7 days have passed since the due date.

Steps to Reproduce

Environment: Temp

tyagishuchi1 commented 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)

ashishjur commented 4 years ago

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