We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 91bed72 commit 61fbf11Copy full SHA for 61fbf11
1 file changed
packages/donate-button-v4/src/components/widget/context/NonprofitContext.tsx
@@ -62,11 +62,18 @@ export const NonprofitContextProvider: FunctionalComponent<{
62
}
63
64
65
- try {
66
- const customizationResponse = await getCustomization(response.id, code);
67
- setCustomization(customizationResponse);
68
- } catch {
69
- setCustomization(DonateFlowCustomizationFetchError);
+ if (code) {
+ try {
+ const customizationResponse = await getCustomization(
+ response.id,
+ code
70
+ );
71
+ setCustomization(customizationResponse);
72
+ } catch {
73
+ setCustomization(DonateFlowCustomizationFetchError);
74
+ }
75
+ } else {
76
+ setCustomization(undefined);
77
78
} catch {
79
setNonprofit(NonprofitFetchError);
0 commit comments