Skip to content

Commit 193c9b9

Browse files
committed
fix: streamline associated deals formatting and improve error message clarity
1 parent cd9dd17 commit 193c9b9

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/modules/deals/deal/DealAssociatedDealsTable.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,10 @@ function useDealAssociatedDealsData({
4646
Boolean(data?.deal?.requestorder?.dealsHasNextNext?.length)
4747
);
4848

49-
const formattedAssociatedDeal =
50-
associatedDeals.map((associatedDeal) => ({
51-
...associatedDeal,
52-
destination: `/deal/${associatedDeal.dealid}`,
53-
})) ?? [];
49+
const formattedAssociatedDeal = associatedDeals.map((associatedDeal) => ({
50+
...associatedDeal,
51+
destination: `/deal/${associatedDeal.dealid}`,
52+
}));
5453

5554
return {
5655
data: formattedAssociatedDeal,
@@ -81,7 +80,7 @@ export function DealAssociatedDealsTable({
8180
hasPastError,
8281
} = useDealAssociatedDealsData({
8382
dealId,
84-
currentPage,
83+
currentPage: currentPage - 1,
8584
});
8685

8786
useEffect(
@@ -96,7 +95,7 @@ export function DealAssociatedDealsTable({
9695
return (
9796
<div className="space-y-6">
9897
{hasPastError && !associatedDeals.length ? (
99-
<ErrorAlert message="An error occurred during deal associatedDeals loading." />
98+
<ErrorAlert message="An error occurred during associated deals loading." />
10099
) : (
101100
<DataTable columns={columns} data={associatedDeals} />
102101
)}

src/modules/tasks/task/TaskRawData.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export function TaskRawData({
7474
[isLoading, isRefetching, setLoading]
7575
);
7676
useEffect(
77-
() => setOutdated(Boolean(tasks) && !isLoading && isError),
77+
() => setOutdated(tasks && !isLoading && isError),
7878
[tasks, isLoading, isError, setOutdated]
7979
);
8080
const { address: userAddress } = useUserStore();

0 commit comments

Comments
 (0)