diff --git a/lib/components/data/mic.jsx b/lib/components/data/mic.jsx index 14b575c0..e70d8b95 100644 --- a/lib/components/data/mic.jsx +++ b/lib/components/data/mic.jsx @@ -56,10 +56,13 @@ export const Widget = React.memo(() => { }, [dragging, volume]); React.useEffect(() => { - if (_volume && parseInt(_volume, 10) !== volume) { - setVolume(parseInt(_volume, 10)); - } - }, [_volume, volume]); + setVolume((currentVolume) => { + if (_volume && currentVolume !== parseInt(_volume, 10)) { + return parseInt(_volume, 10); + } + return currentVolume; + }); + }, [_volume]); if (loading) return ; if (!state || volume === undefined || _volume === "missing value") diff --git a/lib/components/data/sound.jsx b/lib/components/data/sound.jsx index 4c496719..b5bf9e50 100644 --- a/lib/components/data/sound.jsx +++ b/lib/components/data/sound.jsx @@ -68,6 +68,7 @@ export const Widget = React.memo(() => { if (_volume && currentVolume !== parseInt(_volume, 10)) { return parseInt(_volume, 10); } + return currentVolume; }); }, [_volume]);