Skip to content

Commit 04e357b

Browse files
authored
Use proper array type (#447)
1 parent fc84ba0 commit 04e357b

File tree

2 files changed

+1
-6
lines changed
  • packages/donate-button-v4/src/components/widget

2 files changed

+1
-6
lines changed

packages/donate-button-v4/src/components/widget/components/PaymentProcess/PaymentMethodSelect/index.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,8 @@ const usePaymentMethods = () => {
4545
() =>
4646
methods
4747
.filter((method) => {
48-
// There is a bug where instead of being a proper array of disabled methods,
49-
// it comes as an array of length 1 with a comma-separated string inside
5048
if (
51-
nonprofit?.metadata?.disabledPaymentFlowOptions?.length === 1 &&
52-
nonprofit?.metadata?.disabledPaymentFlowOptions[0]?.includes(method)
49+
nonprofit?.metadata?.disabledPaymentFlowOptions?.includes(method)
5350
) {
5451
return false;
5552
}

packages/donate-button-v4/src/components/widget/types/Nonprofit.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ export interface Nonprofit {
1818
nteeCode: string | null;
1919
metadata?: {
2020
customTaxDeductible?: string;
21-
// Note that multiple payment methods can be disabled, but for some reason it arrives
22-
// as an array of length 1 eg ["card,paypal"] from the API, so we type it as such here
2321
disabledPaymentFlowOptions?: string[];
2422
disablePrivateNotes?: boolean;
2523
granteeName?: string;

0 commit comments

Comments
 (0)