Skip to content

Commit

Permalink
ISPN-16052 Refresh on clear metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
karesti committed May 15, 2024
1 parent d9032ba commit 29e9af0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/app/ClearMetrics/ClearMetrics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import { Button, ButtonVariant, Modal, Text, TextContent } from '@patternfly/react-core';
import { useTranslation } from 'react-i18next';
import { useClearStats } from '@app/services/statsHook';
import { useCacheDetail } from '@app/services/cachesHook';

/**
* ClearMetrics entry modal
Expand All @@ -13,7 +14,11 @@ const ClearMetrics = (props: {
closeModal: () => void;
}) => {
const { t } = useTranslation();
const { onClearStats } = useClearStats(props.name, props.type, props.closeModal);
const { loadCache } = useCacheDetail();
const { onClearStats } = useClearStats(props.name, props.type, () => {
loadCache(props.name);
props.closeModal();
});
const label = props.type == 'global-stats' ? props.type : 'caches.' + props.type;

return (
Expand Down

0 comments on commit 29e9af0

Please sign in to comment.