Disable premium price check when running in development mode#226
Conversation
|
This would be useful for local development. I think there is one issue though: returning early from init() in development leaves all of the price objects null, but the Premium CTA still appears clickable. The button state is keyed off loadingCheckoutUrl[v2ActivePrice?.id], so with v2ActivePrice === null it does not become disabled. Clicking it then calls handleUpgrade(v2ActivePrice), and that later reads price.id, which looks like it would throw. Maybe either disable the upgrade actions entirely when price loading is skipped in development, or provide mock price data for dev mode? Should make it safer. |
|
Good spot. I think mock price data would be better as it would avoid disabling UI features in dev mode. Will get to that when I have time, hopefully this evening! |
|
@maxwellward The frontend mock-price fix looks good, but I think the new change in createEvent introduces a regression: ownerId is being set to primitive.NilObjectID unconditionally after the signed-in branch, so authenticated users would create ownerless events. |
|
@jonyTF Looks good to me. |
Adds a simple check to disable the Stripe API price check when in development mode. Avoids a 500 error when doing local dev as Stripe API isn't accessible