This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
Fix JS console error when COD is enabled and no shipping method is available. #3086
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
senadir
added
type: bug
The issue/PR concerns a confirmed bug.
block: checkout
Issues related to the checkout block.
status: needs review
labels
Aug 31, 2020
Size Change: +19 B (0%) Total Size: 1.11 MB
ℹ️ View Unchanged
|
Aljullu
approved these changes
Aug 31, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This solution looks good to me. 👍
If I understand it correctly, that means selectedShippingRates
will only contain packages that have a selected shipping rate, correct? Do you think we could add this info to the doc comment above useSelectShippingRate
? I feel this area might be confusing so maybe it's better to explicitly explain it.
senadir
force-pushed
the
fix/js-error-with-cod-and-shipping
branch
from
August 31, 2020 15:24
1716e18
to
ee809a2
Compare
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
block: checkout
Issues related to the checkout block.
type: bug
The issue/PR concerns a confirmed bug.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Only return selected shipping methods from useSelectShippingRate, this fixes an issue with COD in which we try to see if user can make a payment based on the selected shipping method, the hook returned a broken object
{ 0: undefined }
but it should have returned an empty object instead.Fixes #2987
How to test the changes in this Pull Request:
selectedMethod is undefined
on the console.Changelog