-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug fix NaN displaying in GUI #392
Conversation
Added section to README recommending Polar for lightning network testing while working on Alby, for those who may not know about it.
Thanks for the PR and finding this issue! PS. This is also broken btw. in screens/ConfirmPayment My suggestions:
Bonus: |
Awesome thanks for the suggestions! This makes more sense for sure, I have made the changes you suggested and also disabled the button when the input is empty. Everything seems to be working now as you described and this also fixed the ConfirmPayment screen input as well. I tried adding the disable button feature to the ConfirmPayment screen but was not able to get it working yet, I think it is a bit more complicated because that is a Class component instead of a Function one. One thing I tried was: |
Great work and thanks again for finding this issue! I think disabling the confirm in ConfirmPayment is not necessary. I have 1 suggestion left though as inside ConfirmPayment budget can still be set to NaN. We can for e.g. change line 49: So budget won't be set to NaN in case the field is left empty. What you think? |
Thanks and no problem I am glad I was able to find a bug. :) I can make that change for sure, but for some reason changing the input type to number in I just thought I should let you know about this, but do you still want me to go ahead with the other changes we made? That seems to be the more explicit way of handling this instead of just relying on |
Yeah so it's currently working fine as NaN won't show up with type="number" and when submitting there is a check if budget is "truthy". But I think we don't want the state to be set to NaN (in the background) anyway so to be more correct I'd say we add " Might prevent future errors. |
Sounds good thanks a lot for working through this with me, it is a great learning opportunity for me! I made the change and am running into a Type error now:
Still new to TypeScript but I tried changing the Props type in the AllowanceMenu to |
No problem: |
Well its weird because Update: Those changes did work though, you can take a look at them in the latest commit. |
Thanks! |
Bug fix for issue #382, this should solve the problem of NaN displaying in the GUI and blocking users from inputting an allowance. It will also prevent NaN from being set as the
budget
state.Please ignore the unrelated commit that I added and removed, I accidentally made a different PR from the master branch of my Alby fork and I have a bunch of PRs waiting right now so I can't delete my fork and re-fork yet to have a clean master branch (if that makes sense). The commit that matters for this PR is the Bug fix one.
Thanks :D