-
Notifications
You must be signed in to change notification settings - Fork 10
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
GEN-2430 - fix(new-price-calculator): navigation between price calculator pages #4693
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @guilhermespopolin and the rest of your teammates on Graphite |
setPriceIntentId(priceIntent.id) | ||
}) | ||
const createPriceIntent = () => { | ||
if (createPriceIntentStatus.current !== 'pending') { |
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 effect has a long dependency list. This is used to avoid calling createPriceIntent
function more than once while there's an ongoing process for creating a price intent. If we call it more than once we'll have an issue where the user sees PurchaseForm on it's fillForm state right before being stuck on the loading state.
|
||
export const currentPriceIntentIdAtom = atom( | ||
(get) => { | ||
const priceTemplateName = getAtomValueOrThrow(get, priceTemplateAtom).name |
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.
I think depending on another singleton atom does not solve the root cause. Can we provide the key via react context, similar to how ProductDataProvider
is implemented?
2ad4dde
to
e753b8c
Compare
e753b8c
to
c189cab
Compare
c189cab
to
07c0184
Compare
Describe your changes
Fix an issue while navigating between price calculator pages:
Screen.Recording.2024-09-13.at.10.44.25.mov
That happens because
currentPriceIntentId
was being shared among products.