diff --git a/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/Overview.tsx b/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/Overview.tsx index 12434e6224..6e497b017e 100644 --- a/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/Overview.tsx +++ b/kafka-ui-react-app/src/components/Topics/Topic/Details/Overview/Overview.tsx @@ -39,11 +39,13 @@ const Overview: React.FC = ({ }) => { const { isReadOnly } = React.useContext(ClusterContext); - const messageCount = React.useMemo(() => { - return (partitions || []).reduce((memo, partition) => { - return memo + partition.offsetMax - partition.offsetMin; - }, 0); - }, [partitions]); + const messageCount = React.useMemo( + () => + (partitions || []).reduce((memo, partition) => { + return memo + partition.offsetMax - partition.offsetMin; + }, 0), + [partitions] + ); return ( <> diff --git a/kafka-ui-react-app/src/components/Topics/Topic/SendMessage/SendMessage.tsx b/kafka-ui-react-app/src/components/Topics/Topic/SendMessage/SendMessage.tsx index 5b641385a6..a4087a36cf 100644 --- a/kafka-ui-react-app/src/components/Topics/Topic/SendMessage/SendMessage.tsx +++ b/kafka-ui-react-app/src/components/Topics/Topic/SendMessage/SendMessage.tsx @@ -6,7 +6,10 @@ import { useHistory, useParams } from 'react-router-dom'; import { clusterTopicMessagesPath } from 'lib/paths'; import jsf from 'json-schema-faker'; import { messagesApiClient } from 'redux/reducers/topicMessages/topicMessagesSlice'; -import { fetchTopicMessageSchema } from 'redux/reducers/topics/topicsSlice'; +import { + fetchTopicMessageSchema, + fetchTopicDetails, +} from 'redux/reducers/topics/topicsSlice'; import { useAppDispatch, useAppSelector } from 'lib/hooks/redux'; import { alertAdded } from 'redux/reducers/alerts/alertsSlice'; import { now } from 'lodash'; @@ -126,6 +129,7 @@ const SendMessage: React.FC = () => { partition, }, }); + dispatch(fetchTopicDetails({ clusterName, topicName })); } catch (e) { dispatch( alertAdded({ diff --git a/kafka-ui-react-app/src/redux/reducers/topicMessages/topicMessagesSlice.ts b/kafka-ui-react-app/src/redux/reducers/topicMessages/topicMessagesSlice.ts index a5790776e3..8760c95494 100644 --- a/kafka-ui-react-app/src/redux/reducers/topicMessages/topicMessagesSlice.ts +++ b/kafka-ui-react-app/src/redux/reducers/topicMessages/topicMessagesSlice.ts @@ -4,6 +4,7 @@ import { TopicMessage, Configuration, MessagesApi } from 'generated-sources'; import { BASE_PARAMS } from 'lib/constants'; import { getResponse } from 'lib/errorHandling'; import { showSuccessAlert } from 'redux/reducers/alerts/alertsSlice'; +import { fetchTopicDetails } from 'redux/reducers/topics/topicsSlice'; const apiClientConf = new Configuration(BASE_PARAMS); export const messagesApiClient = new MessagesApi(apiClientConf); @@ -23,7 +24,7 @@ export const clearTopicMessages = createAsyncThunk< topicName, partitions, }); - + dispatch(fetchTopicDetails({ clusterName, topicName })); dispatch( showSuccessAlert({ id: `message-${topicName}-${clusterName}-${partitions}`,