mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-13 21:53:43 +01:00
[web] Fix bug where VAT value isn't retained properly when changing plan without reloading (#23211)
Fix VAT info is not properly updated when changing plan without reloading. I removed `setPlan` and created a new function: `updatePlan`. In the new function, I call the recurly function directly and the tracking code. This way, we can be sure that changing plan won't call useLayoutEffect. Also, remove unused `useState` on the `planCode` GitOrigin-RevId: 0d6d9fac32c15dcf13e35cf9cd9161aa07581938
This commit is contained in:
@@ -30,9 +30,6 @@ export type PaymentContextValue = {
|
||||
>
|
||||
plan: Plan
|
||||
planCode: string
|
||||
setPlanCode: React.Dispatch<
|
||||
React.SetStateAction<PaymentContextValue['planCode']>
|
||||
>
|
||||
planName: string
|
||||
planOffersFreeTrial: boolean
|
||||
pricing: React.MutableRefObject<SubscriptionPricingInstanceCustom | undefined>
|
||||
@@ -73,4 +70,5 @@ export type PaymentContextValue = {
|
||||
setStudentConfirmationChecked: React.Dispatch<
|
||||
React.SetStateAction<PaymentContextValue['studentConfirmationChecked']>
|
||||
>
|
||||
updatePlan: (newPlanCode: string) => void
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user