From 80caf8d6d40a998159a3eaae6b9a3048363578e1 Mon Sep 17 00:00:00 2001 From: Luciano Gorza Date: Wed, 20 Sep 2023 15:31:13 -0300 Subject: [PATCH] Add useEffect to component UpToDateStatus --- .../public/components/up-to-date-status.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/plugins/wazuh-check-updates/public/components/up-to-date-status.tsx b/plugins/wazuh-check-updates/public/components/up-to-date-status.tsx index 4dd1db2f14..e5bcdda52c 100644 --- a/plugins/wazuh-check-updates/public/components/up-to-date-status.tsx +++ b/plugins/wazuh-check-updates/public/components/up-to-date-status.tsx @@ -26,11 +26,8 @@ export const UpToDateStatus = ({ setCurrentUpdate }: UpToDateStatusProps) => { const currentUpdate = getCurrentAvailableUpdate(availableUpdates); useEffect(() => { - if (!availableUpdates) { - return; - } setCurrentUpdate(currentUpdate); - }, [availableUpdates]); + }, [currentUpdate]); const isUpToDate = !currentUpdate;