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

Watch currentShippingMethod instead of shipping_method #414

Merged
merged 2 commits into from
Jan 31, 2024

Conversation

indykoning
Copy link
Member

CurrentShippingMethod will update on changes in checkout.shipping_methods and checkout.shipping_method
Because checkout.shipping_method was being watched while currentShippingMethod is being used in selectShippingMethod(), a race condition could occur where checkout.shipping_methods was empty while checkout.shipping_method was filled.

Resulting in currentShippingMethod.carrier_code throwing an error breaking the shipping-information API request.

By watching currentShippingMethod we are also waiting for the shipping_methods to be filled before attempting to update the shipping method

@indykoning indykoning merged commit ceba1e5 into master Jan 31, 2024
12 checks passed
@indykoning indykoning deleted the fix/undefined-currenshippingmethod branch January 31, 2024 12:42
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.

2 participants