using key on rendered checkbox to avoid react errors; dispatching updatePreferences to update playInVlc.
This commit is contained in:
@@ -40,6 +40,7 @@ function renderPlaybackSection (state) {
|
|||||||
|
|
||||||
function renderPlayInVlcSelector (state) {
|
function renderPlayInVlcSelector (state) {
|
||||||
return renderCheckbox({
|
return renderCheckbox({
|
||||||
|
key: 'play-in-vlc',
|
||||||
label: 'Play in VLC',
|
label: 'Play in VLC',
|
||||||
description: 'Media will play in VLC',
|
description: 'Media will play in VLC',
|
||||||
property: 'playInVlc',
|
property: 'playInVlc',
|
||||||
@@ -47,7 +48,7 @@ function renderPlayInVlcSelector (state) {
|
|||||||
},
|
},
|
||||||
state.unsaved.prefs.playInVlc,
|
state.unsaved.prefs.playInVlc,
|
||||||
function (value) {
|
function (value) {
|
||||||
setStateValue('playInVlc', value)
|
dispatch('updatePreferences', 'playInVlc', value)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,7 +121,7 @@ function renderCheckbox (definition, value, callback) {
|
|||||||
if (value) iconClass += ' enabled'
|
if (value) iconClass += ' enabled'
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='control-group'>
|
<div key='{definition.key}' className='control-group'>
|
||||||
<div className='controls'>
|
<div className='controls'>
|
||||||
<label className='control-label'>
|
<label className='control-label'>
|
||||||
<div className='preference-title'>{definition.label}</div>
|
<div className='preference-title'>{definition.label}</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user