Skip to content

Commit

Permalink
[Synthetics] refresh data on visualization scrubbing (#156777)
Browse files Browse the repository at this point in the history
Co-authored-by: Shahzad <[email protected]>
(cherry picked from commit 29fe83f)
  • Loading branch information
dominiqueclarke committed May 5, 2023
1 parent ef2f448 commit dc7bcdb
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ import { EuiLoadingSpinner, EuiLoadingChart } from '@elastic/eui';
import { PageLoader } from '../common/components/page_loader';
import { resetMonitorLastRunAction } from '../../state';
import { useMonitorLatestPing } from './hooks/use_monitor_latest_ping';
import { useSyntheticsRefreshContext } from '../../contexts';

export const MonitorPendingWrapper: React.FC = ({ children }) => {
const dispatch = useDispatch();
const history = useHistory();
const currentLocation = useLocation();
const locationRef = useRef(currentLocation);
const { monitorId } = useParams<{ monitorId: string }>();
const { refreshApp } = useSyntheticsRefreshContext();

const { latestPing, loaded: pingsLoaded } = useMonitorLatestPing();
const [loaded, setLoaded] = useState(false);
Expand All @@ -36,9 +38,10 @@ export const MonitorPendingWrapper: React.FC = ({ children }) => {
setLoaded(false);
setHasPing(false);
dispatch(resetMonitorLastRunAction());
refreshApp();
}
}),
[history, monitorId, dispatch]
[history, monitorId, dispatch, refreshApp]
);

useEffect(() => {
Expand Down

0 comments on commit dc7bcdb

Please sign in to comment.