diff --git a/app/[chain]/referendum-rewards/components/form-actions.tsx b/app/[chain]/referendum-rewards/components/form-actions.tsx index b269d1c..518ed7d 100644 --- a/app/[chain]/referendum-rewards/components/form-actions.tsx +++ b/app/[chain]/referendum-rewards/components/form-actions.tsx @@ -79,11 +79,7 @@ export default function FormActions({ const otherSteps = [0, 1, 2].filter((index) => index > step).map(String); const [signingIndex, setSigningIndex] = useState(0); - if (!rewardSendoutData?.kusamaAssetHubTxs) { - return; - } - const amountOfTxs = Math.ceil(rewardSendoutData?.kusamaAssetHubTxs?.length / rewardsConfig.NFT_BATCH_SIZE_MAX); - + const [txResult, setTxResult] = useState(); const formMethods = useFormContext(); @@ -98,6 +94,12 @@ export default function FormActions({ const watchFormFields = watch(); + if (!rewardSendoutData?.kusamaAssetHubTxs) { + // It's better to handle this condition differently or ensure the layout still renders without functional impact. + return
No transactions found
; + } + const amountOfTxs = Math.ceil(rewardSendoutData?.kusamaAssetHubTxs?.length / rewardsConfig.NFT_BATCH_SIZE_MAX); + function onReset() { setStep(0); reset();