mirror of
https://github.com/RoboSats/robosats.git
synced 2024-12-13 19:06:26 +00:00
9a1007775f
Fixing the type handlePremiumChange function to handle the discount to the right type (React.ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement>) Using the correct type of handlePremiumChange function, then deconstructing the "value" var from the event.target Using Number(value) in declaration of "newPremium", instead of using multiplication with number and string To not affect another methods using "premium" var, I used isNaN func to make a check and set the initial value of "premium" var to zero (if is NaN) or newPremium (when valid number is entered) The fix in the bug is the line "premium: isNaN(newPremium) || value === '' ? '' : premium," in setMaker. That makes the "premium" var to be set to zero when the input is empty or not a number, allowing the user to input the "-" (minus sign) and not entering 0 as before. |
||
---|---|---|
.. | ||
src | ||
static | ||
templates/frontend | ||
__init__.py | ||
.eslintrc.json | ||
.prettierignore | ||
.prettierrc | ||
admin.py | ||
apps.py | ||
babel.config.json | ||
Dockerfile | ||
entrypoint.sh | ||
package-lock.json | ||
package.json | ||
tests.py | ||
tsconfig.json | ||
urls.py | ||
views.py | ||
webpack.config.ts |