diff --git a/frontend/app/components/shared/SessionSettings/components/CaptureRate.tsx b/frontend/app/components/shared/SessionSettings/components/CaptureRate.tsx index 6436bd652..9576de72a 100644 --- a/frontend/app/components/shared/SessionSettings/components/CaptureRate.tsx +++ b/frontend/app/components/shared/SessionSettings/components/CaptureRate.tsx @@ -4,10 +4,12 @@ import { useStore } from 'App/mstore'; import { useObserver } from 'mobx-react-lite'; function CaptureRate(props) { + const [changed, setChanged] = React.useState(false); const { settingsStore } = useStore(); const sessionSettings = useObserver(() => settingsStore.sessionSettings) const [captureRate, setCaptureRate] = React.useState(sessionSettings.captureRate); const [captureAll, setCaptureAll] = React.useState(captureRate === 100); + return ( <>

Capture Rate

@@ -16,7 +18,10 @@ function CaptureRate(props) { setCaptureAll(!captureAll)} + onChange={() => { + setCaptureAll(!captureAll) + setChanged(true) + }} label="Capture 100% of the sessions" /> @@ -26,7 +31,10 @@ function CaptureRate(props) { type="number" value={captureRate} style={{ height: '38px', width: '100px'}} - onChange={(e, { value }) => setCaptureRate(value)} + onChange={(e, { value }) => { + setCaptureRate(value) + setChanged(true); + }} disabled={captureAll} min={0} minValue={0} @@ -34,7 +42,7 @@ function CaptureRate(props) { of the sessions - + );