Skip to content

Commit

Permalink
fix: [Sale Widget] excludePaymentTypes param initial value (#1624)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhesgodi authored Mar 26, 2024
1 parent 65cd502 commit b28088d
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,10 @@ export function SaleContextProvider(props: {
>(undefined);

const [fundingRoutes, setFundingRoutes] = useState<FundingRoute[]>([]);
const [disabledPaymentTypes, setDisabledPaymentTypes] = useState<
SalePaymentTypes[]
>(excludePaymentTypes || []);
const [disabledPaymentTypes, setDisabledPaymentTypes] = useState<SalePaymentTypes[]>([]);

const disablePaymentTypes = (types: SalePaymentTypes[]) => {
setDisabledPaymentTypes((prev) => [...prev, ...types]);
setDisabledPaymentTypes((prev) => Array.from(new Set([...(prev || []), ...types])));
};

const [invalidParameters, setInvalidParameters] = useState<boolean>(false);
Expand Down

0 comments on commit b28088d

Please sign in to comment.