Refetch page after clearing blocklist and refreshing events

This commit is contained in:
Bogdan 2026-04-20 11:23:06 +03:00 committed by Mark McDowall
parent 6131f1debd
commit 62e5078aeb
2 changed files with 10 additions and 11 deletions

View file

@ -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);

View file

@ -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 (
<PageContent title={translate('Logs')}>