Skip to content

Commit

Permalink
fix: disable exhaustive dep (#1743)
Browse files Browse the repository at this point in the history
  • Loading branch information
keellyp committed Sep 18, 2024
1 parent f290f3c commit a84a0bf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/components/customers/overview/CustomerOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export const CustomerOverview: FC<CustomerOverviewProps> = ({
if (hasPermissions(['analyticsView'])) {
getCustomerGrossRevenues()
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [externalCustomerId])

const grossRevenues = (grossRevenuesData?.grossRevenues.collection || []).reduce(
Expand Down
28 changes: 18 additions & 10 deletions src/pages/CustomerRequestOverduePayment/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,17 +166,25 @@ const CustomerRequestOverduePayment: FC = () => {
)
const totalInvoices = invoicesCollection.length

useEffect(() => {
if (hasDefinedGQLError('NotFound', error, 'customer')) {
navigate(ERROR_404_ROUTE)
}
}, [error])
useEffect(
() => {
if (hasDefinedGQLError('NotFound', error, 'customer')) {
navigate(ERROR_404_ROUTE)
}
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[error],
)

useEffect(() => {
if (loading === false && totalAmount <= 0) {
navigate(ERROR_404_ROUTE)
}
}, [loading, totalAmount])
useEffect(
() => {
if (loading === false && totalAmount <= 0) {
navigate(ERROR_404_ROUTE)
}
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[loading, totalAmount],
)

return (
<>
Expand Down

0 comments on commit a84a0bf

Please sign in to comment.