From 32de16c18e0c9016bd6a90a57d78e5bd3174ef9e Mon Sep 17 00:00:00 2001 From: David Colon <38386583+Da-Colon@users.noreply.github.com> Date: Tue, 12 Nov 2024 21:32:12 -0500 Subject: [PATCH] pass smartAddress for non-termed roles --- src/hooks/DAO/loaders/useHatsTree.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/hooks/DAO/loaders/useHatsTree.ts b/src/hooks/DAO/loaders/useHatsTree.ts index c964dfd32c..9a15b0961f 100644 --- a/src/hooks/DAO/loaders/useHatsTree.ts +++ b/src/hooks/DAO/loaders/useHatsTree.ts @@ -266,6 +266,7 @@ const useHatsTree = () => { return hat; } const payments: SablierPayment[] = []; + // @todo - update Datepicker to choose more precise dates (Date.now()) if (hat.isTermed) { const recipients = hat.roleTerms.allTerms.map(term => term.nominee); const uniqueRecipients = [...new Set(recipients)]; @@ -273,7 +274,10 @@ const useHatsTree = () => { payments.push(...(await getPaymentStreams(recipient))); } } else { - payments.push(...(await getPaymentStreams(hat.wearerAddress))); + if (!hat.smartAddress) { + throw new Error('Smart account address not found'); + } + payments.push(...(await getPaymentStreams(hat.smartAddress))); } return { ...hat, payments };