-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
The way the app is intended to work:
If a user submits a date in the past:
- the binary search algorithm initiates to find the corresponding blockheight to the target date
- the corresponding blockheight is displayed on the home page under "Target Blockheight"
If a user submits a date in the future:
- a calculation is performed to estimate the future blockheight, based on 10 minute blocks
- the estimated blockheight is displayed on the homepage under "Target Blockheight" with " (estimate)" appended
- a new form appears on the home page allowing the user to enter text for their "stamp"
- after submission, the text and the target blockheight are saved into the db
Currently, the trigger for the stamp form to appear is dictated by the presence of the string " (estimate)" in the target blockheight
This could probably be done in a cleaner way. Maybe a flag or something to indicate "user submitted future date"?
Instead of appending text to the variable as it currently works, would be nice to have something under the hood to discern future or present date submission. Then maybe render the blockheight variable in a different way (different color?) to indicate past or present target date/blockheight.
This change would likely effect:
- blockheight.go (BinarySearch()) > this is where " (estimate)" is appended
- blockheight.go (GetBlockheightByDate()) > sends flag to /get-blockheight in main.go, dictated by presence of " (estimate)" string, which determines if the stamp form is displayed to the user or not
- stamps.go (SubmitStamp()) > the " (estimate)" string is removed using regex before converted to an integer and saved to db
Metadata
Metadata
Assignees
Labels
No labels