feat(measurements): Provide for the Load (SR) measurements button to optionally clear existing measurements prior to loading the SR. (#4586)

This commit is contained in:
Joe Boccanfuso authored and GitHub committed 2024-12-18 11:33:40 -05:00
1 parent 7eec015ff1
commit 4d3d5e794c
15 files changed
+185 -128

No files matched your search

@@ -272,6 +272,14 @@ function TrackedMeasurementsContextProvider(
viewports,
]);
useEffect(() => {
// The command needs to be bound to the context's sendTrackedMeasurementsEvent
// so the command has to be registered in a React component.
commandsManager.registerCommand('DEFAULT', 'loadTrackedSRMeasurements', {
commandFn: props => sendTrackedMeasurementsEvent('HYDRATE_SR', props),
});
}, [commandsManager, sendTrackedMeasurementsEvent]);
return (
<TrackedMeasurementsContext.Provider
value={[trackedMeasurements, sendTrackedMeasurementsEvent]}