robosats/frontend
João Leal 9a1007775f
Fix bug with negative premium textfield (#614)
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.
2023-05-26 10:32:22 +00:00
..
src Fix bug with negative premium textfield (#614) 2023-05-26 10:32:22 +00:00
static Fix bug with negative premium textfield (#614) 2023-05-26 10:32:22 +00:00
templates/frontend Fix all files with pre-commit 2022-10-25 11:04:12 -07:00
__init__.py Add frontend app 2022-01-01 15:05:55 -08:00
.eslintrc.json Add version mismatch detection, refactor GH workflows, draft release.yml, increase prettier scope (#250) 2022-09-21 07:03:38 -07:00
.prettierignore Add pgp signature to sensitive client - coordinator messages (#592) 2023-05-17 13:06:04 +00:00
.prettierrc Add linter and formatter 2022-08-28 00:20:45 +02:00
admin.py Conform to pep8 rules (#295) 2022-10-20 20:53:51 +00:00
apps.py Re-format all python code 2022-02-17 11:50:10 -08:00
babel.config.json Add version mismatch detection, refactor GH workflows, draft release.yml, increase prettier scope (#250) 2022-09-21 07:03:38 -07:00
Dockerfile Minor fixes on dev setup start up 2023-05-17 04:16:26 -07:00
entrypoint.sh Migrate to react-dom-router v6 (#422) 2023-04-16 18:10:48 +00:00
package-lock.json Bump react-router-dom from 6.11.0 to 6.11.2 in /frontend (#623) 2023-05-26 10:21:46 +00:00
package.json Small style fixes and new payment method 2023-05-12 03:01:17 -07:00
tests.py Conform to pep8 rules (#295) 2022-10-20 20:53:51 +00:00
tsconfig.json Add version mismatch detection, refactor GH workflows, draft release.yml, increase prettier scope (#250) 2022-09-21 07:03:38 -07:00
urls.py Add RobotTokenSHA256 middleware, /api/robot and frontend entropy calc (#512) 2023-05-05 10:12:38 +00:00
views.py Add pre-commit-config (#298) 2022-10-24 14:34:21 +00:00
webpack.config.ts New Robot page (#357) 2023-02-21 17:22:48 +00:00