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

fix: Toast bugs #2118

Merged
merged 3 commits into from
Nov 22, 2023
Merged

fix: Toast bugs #2118

merged 3 commits into from
Nov 22, 2023

Conversation

lariciamota
Copy link
Contributor

@lariciamota lariciamota commented Nov 20, 2023

What's the purpose of this pull request?

Fix a loop bug on toast: when adding more units than the max allowed for a product, a toast was shown and the cart was changed automatically decreasing the quantity to the max, but the toast kept being shown because the orderform would still have the message.
Also fixed another bug on toast: when adding a product and then changing the zip code that doesn't deliver that product, the toast wasn't being shown.

How it works?

For the first case: cleaning the orderform messages clearOrderFormMessages(orderNumber, ctx) fixes the loop.

For the second case: making validateCart check changes in the orderform messages field fixes the issue. The toast in this case will only stop being shown if the user changes the zip code to a valid one or remove the item from the cart.

How to test it?

First case:

1.mov

Second case:

2.mov

Starters Deploy Preview

References

Slack thread

Copy link

vercel bot commented Nov 20, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
faststore-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 22, 2023 2:20pm

Copy link

codesandbox-ci bot commented Nov 20, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 6974ce1:

Sandbox Source
Store UI Typescript Configuration

@lariciamota lariciamota marked this pull request as ready for review November 22, 2023 13:04
@lariciamota lariciamota requested a review from a team as a code owner November 22, 2023 13:04
@lariciamota lariciamota requested review from hellofanny and ArthurTriis1 and removed request for a team November 22, 2023 13:04
@lariciamota lariciamota changed the title fix: Toast loop fix: Toast bugs Nov 22, 2023
@lariciamota lariciamota merged commit f2cadf0 into main Nov 22, 2023
5 checks passed
@lariciamota lariciamota deleted the chore/toast-bug branch November 22, 2023 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants