diff --git a/packages/app/constants/settings/components/compressorValues/index.jsx b/packages/app/constants/settings/components/compressorValues/index.jsx index b41818fc..c8706bb7 100644 --- a/packages/app/constants/settings/components/compressorValues/index.jsx +++ b/packages/app/constants/settings/components/compressorValues/index.jsx @@ -20,7 +20,9 @@ export default (props) => { } React.useEffect(() => { - setValues(props.ctx.currentValue) + if (props.ctx.currentValue) { + setValues(props.ctx.currentValue) + } }, [props.ctx.currentValue]) return
{ handleChangeCommitted("threshold", value)} onChange={(e, value) => handleOnChange("threshold", value)} - value={values.threshold} + value={values?.threshold ?? 0} orientation="vertical" aria-label="Threshold" valueLabelDisplay="auto" @@ -51,7 +53,7 @@ export default (props) => {
- {values.threshold} dB + {values?.threshold ?? 0} dB
@@ -65,7 +67,7 @@ export default (props) => { handleChangeCommitted("knee", value)} onChange={(e, value) => handleOnChange("knee", value)} - value={values.knee} + value={values?.knee ?? 0} orientation="vertical" aria-label="Knee" valueLabelDisplay="auto" @@ -77,7 +79,7 @@ export default (props) => {
- {values.knee} dB + {values?.knee ?? 0} dB
@@ -91,7 +93,7 @@ export default (props) => { handleChangeCommitted("ratio", value)} onChange={(e, value) => handleOnChange("ratio", value)} - value={values.ratio} + value={values?.ratio ?? 0} orientation="vertical" aria-label="Ratio" valueLabelDisplay="auto" @@ -102,7 +104,7 @@ export default (props) => { />
- {values.ratio} : 1 + {values?.ratio ?? 0} : 1
@@ -116,7 +118,7 @@ export default (props) => { handleChangeCommitted("attack", value)} onChange={(e, value) => handleOnChange("attack", value)} - value={values.attack} + value={values?.attack ?? 0} orientation="vertical" aria-label="Attack" valueLabelDisplay="auto" @@ -128,7 +130,7 @@ export default (props) => {
- {values.attack} s + {values?.attack ?? 0} s
@@ -142,7 +144,7 @@ export default (props) => { handleChangeCommitted("release", value)} onChange={(e, value) => handleOnChange("release", value)} - value={values.release} + value={values?.release ?? 0} orientation="vertical" aria-label="Release" valueLabelDisplay="auto" @@ -153,7 +155,7 @@ export default (props) => { />
- {values.release} s + {values?.release ?? 0} s