Skip to content
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

On checkout, canProceedToPayment never actually checks shippingAddress' streetLine1 or postalCode #69

Open
floze opened this issue Feb 1, 2024 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@floze
Copy link

floze commented Feb 1, 2024

This expression never yields false:

selectedAddressIndex != null) &&

...since the initialized value is 0, not null:

const [selectedAddressIndex, setSelectedAddressIndex] = useState(0);

Setting null as the initial value messes up the address selectors default selection, so this needs to be taken care of as well.

It would be wise, I suppose, to furthermore switch all the validations to Remix ValidatedForm / Zod...

@kyunal kyunal added bug Something isn't working help wanted Extra attention is needed labels Feb 4, 2024
@kyunal
Copy link
Collaborator

kyunal commented Feb 4, 2024

First of all, thanks for pointing this out. Just like with the other issue, I will see if I can tackle this some time soon, but contributions are very welcome.

It would be wise, I suppose, to furthermore switch all the validations to Remix ValidatedForm / Zod...

I totally agree with this, and this would be my favourite solution. The current implementation is less than ideal and not in-line with how validations are done in the rest of the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants