hicetnunc icon indicating copy to clipboard operation
hicetnunc copied to clipboard

Feature - Show current hDAO curation amount

Open TezzardzGoneWild opened this issue 2 years ago • 0 comments

The Config -> Advanced section does not currently show you the value saved for your curation making it impossible to see how much will be spent when curating without going into dev tools & local storage (or updating the value prior to each curation). Additionally, it accepts non-integer values, so you can pass in any string.

  • Fetch the value of hDAO_config from local storage when initializing the state and feed that to the Input instead of undefined. This will not care if there is no value in local storage -- it will initialize it as empty in the same way it was with it being explicitly told to always use undefined
  • Use type="number" for the Input. This will ensure only valid values are passed in, and it will prevent it from auto-populating with invalid values that may already be there from when there were no restrictions (invalid values will be populated in the same way as the explicit undefined). This restriction does mean the value needs to be converted .toString() prior to being written to local storage, and ... || '' was added in to prevent errors when someone attempts to save without any changes having been made.

Below are some quick screenshots to show what happens in each of the cases

When the page is loaded and there is no local storage value:

image

When the page is loaded and there is a valid local storage value:

image

When the page is loaded and there is an invalid local storage value:

image

TezzardzGoneWild avatar Nov 07 '21 19:11 TezzardzGoneWild