fix: splitData to object instead of array

This commit is contained in:
P. Reis 2024-09-11 19:31:25 -03:00
parent 139729f7b5
commit 029167cf81
1 changed files with 2 additions and 2 deletions

View File

@ -49,7 +49,7 @@ const ZapPayRequestForm = ({ account, status, onClose }: IZapPayRequestForm) =>
const handleSubmit = async (e?: React.FormEvent<Element>) => {
e?.preventDefault();
const zapSplitAccounts = zapArrays.filter(zapData => zapData.account.id !== account.id);
// const splitData = [hasZapSplit, zapSplitAccounts, splitValues];
const splitData = { hasZapSplit, zapSplitAccounts, splitValues };
const invoice = hasZapSplit ? await dispatch(zap(account, status, zapSplitData.receiveAmount * 1000, zapComment)) : await dispatch(zap(account, status, zapAmount * 1000, zapComment));
// If invoice is undefined it means the user has paid through his extension
@ -64,7 +64,7 @@ const ZapPayRequestForm = ({ account, status, onClose }: IZapPayRequestForm) =>
return;
}
// open QR code modal
dispatch(openModal('ZAP_INVOICE', { account, invoice, hasZapSplit, zapSplitAccounts, splitValues }));
dispatch(openModal('ZAP_INVOICE', { account, invoice, splitData }));
};
const handleCustomAmount = (e: React.ChangeEvent<HTMLInputElement>) => {