Fix broker statistic updates

This commit is contained in:
Thomas Nordquist
2019-07-17 15:56:38 +02:00
parent b33412504d
commit f2d632959b
2 changed files with 19 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ import { Theme, withStyles } from '@material-ui/core/styles'
import { TopicViewModel } from '../../model/TopicViewModel'
import { Typography } from '@material-ui/core'
import { usePollingToFetchTreeNode } from '../helper/usePollingToFetchTreeNode'
import { useUpdateComponentWhenNodeUpdates } from '../helper/useUpdateComponentWhenNodeUpdates'
const abbreviate = require('number-abbreviate')
interface Stats {
@@ -32,6 +33,7 @@ interface Props {
function BrokerStatistics(props: Props) {
const { tree, classes } = props
const sysTopic = usePollingToFetchTreeNode(props.tree, '$SYS')
useUpdateComponentWhenNodeUpdates(sysTopic)
return useMemo(() => {
if (!Boolean(sysTopic)) {