-
Notifications
You must be signed in to change notification settings - Fork 0
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: Browser back button error in Payment page #3
base: master
Are you sure you want to change the base?
Changes from 7 commits
f389d62
b58e169
2cc54bc
2ef9af9
6a34d3b
91c877e
d5a059c
68b7c59
d6e0b78
7b6c18a
e7517bd
3c796a4
2a2e790
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,11 @@ const basket = (state = basketInitialState, action = null) => { | |
loaded: true, | ||
}; | ||
|
||
case BASKET_DATA_RECEIVED: return { ...state, ...action.payload }; | ||
case BASKET_DATA_RECEIVED: | ||
if (action.payload.products && action.payload.products.length > 0) { | ||
localStorage.setItem('sku', action.payload.products[0].sku); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Noted you have new code to handle baskets with more than 1 product. Apart from that, I don't think it's recommended to directly update There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alright 👍 I'll update the code accordingly. Thanks |
||
} | ||
return { ...state, ...action.payload }; | ||
|
||
case BASKET_PROCESSING: return { | ||
...state, | ||
|
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.
Have a couple of questions:
Also, continuing on the other comment I added, you could dispatch an action from this component to set
localStorage
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.
Regarding point 1 I'll update the code so it is specific to PayPal only.
Point 2. Yes I've tested regular credit card purchases
Point 3. On page reload a new basket is created that contains courses/program user was about to purchase. Previously new empty basket was created.