Fix console error

This commit is contained in:
Rafael 2022-04-20 15:55:27 -03:00 committed by Thomas Zarebczan
parent ef7e6a56b4
commit 69671a93d1

View file

@ -20,6 +20,7 @@ export default function SettingDefaultQuality(props: Props) {
if (enabled) { if (enabled) {
setEnabled(false); setEnabled(false);
// From enabled to disabled -> clear the setting // From enabled to disabled -> clear the setting
valueRef.current = defaultQuality;
doSetDefaultVideoQuality(null); doSetDefaultVideoQuality(null);
} else { } else {
setEnabled(true); setEnabled(true);
@ -42,7 +43,7 @@ export default function SettingDefaultQuality(props: Props) {
type="select" type="select"
onChange={handleSetQuality} onChange={handleSetQuality}
disabled={!enabled} disabled={!enabled}
value={defaultQuality} value={defaultQuality || valueRef.current}
> >
{VIDEO_QUALITY_OPTIONS.map((quality) => { {VIDEO_QUALITY_OPTIONS.map((quality) => {
const qualityStr = typeof quality === 'number' ? quality + 'p' : toCapitalCase(quality); const qualityStr = typeof quality === 'number' ? quality + 'p' : toCapitalCase(quality);