From c865fd4fbb8248ee97a715520bff618b5624ad7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20G=C3=B3is?= Date: Tue, 3 Sep 2024 12:29:33 +0100 Subject: [PATCH] fix: reduce integration events requests (#8055) Cuts the total amount of integration event requests in half when browsing the integrations page, by only fetching the 20 latest events for each configured integration when it's actually needed (open modal). --- .../integrations/IntegrationEvents/IntegrationEventsModal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/component/integrations/IntegrationEvents/IntegrationEventsModal.tsx b/frontend/src/component/integrations/IntegrationEvents/IntegrationEventsModal.tsx index 55cdf7cc4a57..e413fb344b7c 100644 --- a/frontend/src/component/integrations/IntegrationEvents/IntegrationEventsModal.tsx +++ b/frontend/src/component/integrations/IntegrationEvents/IntegrationEventsModal.tsx @@ -65,7 +65,7 @@ export const IntegrationEventsModal = ({ const navigate = useNavigate(); const { locationSettings } = useLocationSettings(); const { integrationEvents, hasMore, loadMore, loading } = - useIntegrationEvents(addon?.id, 20, { + useIntegrationEvents(open ? addon?.id : undefined, 20, { refreshInterval: 5000, });