From 62e5078aeb0471cd5afcfa0fa55c58b08a30f380 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Mon, 20 Apr 2026 11:23:06 +0300 Subject: [PATCH] Refetch page after clearing blocklist and refreshing events --- frontend/src/Activity/Blocklist/Blocklist.tsx | 3 ++- frontend/src/System/Events/LogsTable.tsx | 18 ++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/frontend/src/Activity/Blocklist/Blocklist.tsx b/frontend/src/Activity/Blocklist/Blocklist.tsx index b9c3a303e..caa909b60 100644 --- a/frontend/src/Activity/Blocklist/Blocklist.tsx +++ b/frontend/src/Activity/Blocklist/Blocklist.tsx @@ -109,9 +109,10 @@ function BlocklistContent() { const handleClearBlocklistConfirmed = useCallback(() => { executeCommand({ name: CommandNames.ClearBlocklist }, () => { goToPage(1); + refetch(); }); setIsConfirmClearModalOpen(false); - }, [setIsConfirmClearModalOpen, goToPage, executeCommand]); + }, [setIsConfirmClearModalOpen, executeCommand, goToPage, refetch]); const handleConfirmClearModalClose = useCallback(() => { setIsConfirmClearModalOpen(false); diff --git a/frontend/src/System/Events/LogsTable.tsx b/frontend/src/System/Events/LogsTable.tsx index 128726857..3919bfcbb 100644 --- a/frontend/src/System/Events/LogsTable.tsx +++ b/frontend/src/System/Events/LogsTable.tsx @@ -38,6 +38,7 @@ function LogsTable() { isLoading, page, goToPage, + refetch, } = useEvents(); const { columns, pageSize, sortKey, sortDirection, selectedFilterKey } = @@ -77,18 +78,15 @@ function LogsTable() { const handleRefreshPress = useCallback(() => { goToPage(1); - }, [goToPage]); + refetch(); + }, [goToPage, refetch]); const handleClearLogsPress = useCallback(() => { - executeCommand( - { - name: CommandNames.ClearLog, - }, - () => { - goToPage(1); - } - ); - }, [executeCommand, goToPage]); + executeCommand({ name: CommandNames.ClearLog }, () => { + goToPage(1); + refetch(); + }); + }, [executeCommand, goToPage, refetch]); return (