mirror of
https://github.com/jeffvli/sonixd.git
synced 2026-05-18 22:03:12 -04:00
Fix checkboxes to use event handler value
This commit is contained in:
@@ -231,15 +231,12 @@ const NowPlayingMiniView = () => {
|
||||
<StyledCheckbox
|
||||
defaultChecked={playQueue.scrollWithCurrentSong}
|
||||
checked={playQueue.scrollWithCurrentSong}
|
||||
onChange={() => {
|
||||
settings.setSync(
|
||||
'scrollWithCurrentSong',
|
||||
!settings.getSync('scrollWithCurrentSong')
|
||||
);
|
||||
onChange={(_v: any, e: boolean) => {
|
||||
settings.setSync('scrollWithCurrentSong', e);
|
||||
dispatch(
|
||||
setPlaybackSetting({
|
||||
setting: 'scrollWithCurrentSong',
|
||||
value: !playQueue.scrollWithCurrentSong,
|
||||
value: e,
|
||||
})
|
||||
);
|
||||
}}
|
||||
|
||||
@@ -385,15 +385,12 @@ const NowPlayingView = () => {
|
||||
<StyledCheckbox
|
||||
defaultChecked={playQueue.scrollWithCurrentSong}
|
||||
checked={playQueue.scrollWithCurrentSong}
|
||||
onChange={() => {
|
||||
settings.setSync(
|
||||
'scrollWithCurrentSong',
|
||||
!settings.getSync('scrollWithCurrentSong')
|
||||
);
|
||||
onChange={(_v: any, e: boolean) => {
|
||||
settings.setSync('scrollWithCurrentSong', e);
|
||||
dispatch(
|
||||
setPlaybackSetting({
|
||||
setting: 'scrollWithCurrentSong',
|
||||
value: !playQueue.scrollWithCurrentSong,
|
||||
value: e,
|
||||
})
|
||||
);
|
||||
}}
|
||||
|
||||
@@ -433,7 +433,7 @@ const PlaylistView = ({ ...rest }) => {
|
||||
<StyledCheckbox
|
||||
defaultChecked={editPublic}
|
||||
value={editPublic}
|
||||
onChange={() => setEditPublic(!editPublic)}
|
||||
onChange={(_v: any, e: boolean) => setEditPublic(e)}
|
||||
>
|
||||
Public
|
||||
</StyledCheckbox>
|
||||
|
||||
@@ -171,9 +171,9 @@ const CacheConfig = () => {
|
||||
<div style={{ width: '300px', marginTop: '20px' }}>
|
||||
<StyledCheckbox
|
||||
defaultChecked={cacheSongs}
|
||||
onChange={() => {
|
||||
settings.setSync('cacheSongs', !settings.getSync('cacheSongs'));
|
||||
setCacheSongs(!cacheSongs);
|
||||
onChange={(_v: any, e: boolean) => {
|
||||
settings.setSync('cacheSongs', e);
|
||||
setCacheSongs(e);
|
||||
}}
|
||||
>
|
||||
Songs{' '}
|
||||
@@ -183,9 +183,9 @@ const CacheConfig = () => {
|
||||
</StyledCheckbox>
|
||||
<StyledCheckbox
|
||||
defaultChecked={cacheImages}
|
||||
onChange={() => {
|
||||
settings.setSync('cacheImages', !settings.getSync('cacheImages'));
|
||||
setCacheImages(!cacheImages);
|
||||
onChange={(_v: any, e: boolean) => {
|
||||
settings.setSync('cacheImages', e);
|
||||
setCacheImages(e);
|
||||
}}
|
||||
>
|
||||
Images{' '}
|
||||
|
||||
@@ -14,15 +14,15 @@ const DebugConfig = () => {
|
||||
<ConfigPanel header="Advanced" bordered>
|
||||
<StyledCheckbox
|
||||
defaultChecked={showDebugWindow}
|
||||
onChange={() => {
|
||||
settings.setSync('showDebugWindow', !settings.getSync('showDebugWindow'));
|
||||
onChange={(_v: any, e: boolean) => {
|
||||
settings.setSync('showDebugWindow', e);
|
||||
dispatch(
|
||||
setPlaybackSetting({
|
||||
setting: 'showDebugWindow',
|
||||
value: settings.getSync('showDebugWindow'),
|
||||
value: e,
|
||||
})
|
||||
);
|
||||
setShowDebugWindow(!showDebugWindow);
|
||||
setShowDebugWindow(e);
|
||||
}}
|
||||
>
|
||||
Show debug window
|
||||
|
||||
@@ -76,10 +76,10 @@ const LookAndFeelConfig = () => {
|
||||
<StyledCheckbox
|
||||
defaultChecked={dynamicBackgroundChk}
|
||||
checked={dynamicBackgroundChk}
|
||||
onChange={() => {
|
||||
settings.setSync('dynamicBackground', !dynamicBackgroundChk);
|
||||
dispatch(setDynamicBackground(!dynamicBackgroundChk));
|
||||
setDynamicBackgroundChk(!dynamicBackgroundChk);
|
||||
onChange={(_v: any, e: boolean) => {
|
||||
settings.setSync('dynamicBackground', e);
|
||||
dispatch(setDynamicBackground(e));
|
||||
setDynamicBackgroundChk(e);
|
||||
}}
|
||||
>
|
||||
Enable dynamic background
|
||||
@@ -128,15 +128,15 @@ const LookAndFeelConfig = () => {
|
||||
<StyledCheckbox
|
||||
defaultChecked={highlightOnRowHoverChk}
|
||||
checked={highlightOnRowHoverChk}
|
||||
onChange={() => {
|
||||
settings.setSync('highlightOnRowHover', !highlightOnRowHoverChk);
|
||||
onChange={(_v: any, e: boolean) => {
|
||||
settings.setSync('highlightOnRowHover', e);
|
||||
dispatch(
|
||||
setMiscSetting({
|
||||
setting: 'highlightOnRowHover',
|
||||
value: !highlightOnRowHoverChk,
|
||||
value: e,
|
||||
})
|
||||
);
|
||||
setHighlightOnRowHoverChk(!highlightOnRowHoverChk);
|
||||
setHighlightOnRowHoverChk(e);
|
||||
}}
|
||||
>
|
||||
Show highlight on row hover
|
||||
@@ -145,8 +145,8 @@ const LookAndFeelConfig = () => {
|
||||
<p>Select the columns you want displayed on pages with a list-view.</p>
|
||||
<StyledCheckbox
|
||||
defaultChecked={resizableColumn}
|
||||
onChange={() => {
|
||||
setResizableColumn(!resizableColumn);
|
||||
onChange={(_v: any, e: boolean) => {
|
||||
setResizableColumn(e);
|
||||
}}
|
||||
>
|
||||
Use resizable columns (check/uncheck this before selecting columns)
|
||||
|
||||
@@ -45,19 +45,19 @@ const PlayerConfig = () => {
|
||||
<br />
|
||||
<StyledCheckbox
|
||||
defaultChecked={globalMediaHotkeys}
|
||||
onChange={() => {
|
||||
settings.setSync('globalMediaHotkeys', !settings.getSync('globalMediaHotkeys'));
|
||||
setGlobalMediaHotkeys(!globalMediaHotkeys);
|
||||
onChange={(_v: any, e: boolean) => {
|
||||
settings.setSync('globalMediaHotkeys', e);
|
||||
setGlobalMediaHotkeys(e);
|
||||
}}
|
||||
>
|
||||
Enable global media hotkeys (requires app restart)
|
||||
</StyledCheckbox>
|
||||
<StyledCheckbox
|
||||
defaultChecked={scrobble}
|
||||
onChange={() => {
|
||||
settings.setSync('scrobble', !scrobble);
|
||||
dispatch(setPlaybackSetting({ setting: 'scrobble', value: !scrobble }));
|
||||
setScrobble(!scrobble);
|
||||
onChange={(_v: any, e: boolean) => {
|
||||
settings.setSync('scrobble', e);
|
||||
dispatch(setPlaybackSetting({ setting: 'scrobble', value: e }));
|
||||
setScrobble(e);
|
||||
}}
|
||||
>
|
||||
Enable scrobbling
|
||||
|
||||
@@ -12,9 +12,9 @@ const WindowConfig = () => {
|
||||
<StyledCheckbox
|
||||
defaultChecked={minimizeToTray}
|
||||
checked={minimizeToTray}
|
||||
onChange={() => {
|
||||
settings.setSync('minimizeToTray', !settings.getSync('minimizeToTray'));
|
||||
setMinimizeToTray(!minimizeToTray);
|
||||
onChange={(_v: any, e: boolean) => {
|
||||
settings.setSync('minimizeToTray', e);
|
||||
setMinimizeToTray(e);
|
||||
}}
|
||||
>
|
||||
Minimize to tray
|
||||
@@ -23,9 +23,9 @@ const WindowConfig = () => {
|
||||
<StyledCheckbox
|
||||
defaultChecked={exitToTray}
|
||||
checked={exitToTray}
|
||||
onChange={() => {
|
||||
settings.setSync('exitToTray', !settings.getSync('exitToTray'));
|
||||
setExitToTray(!exitToTray);
|
||||
onChange={(_v: any, e: boolean) => {
|
||||
settings.setSync('exitToTray', e);
|
||||
setExitToTray(e);
|
||||
}}
|
||||
>
|
||||
Exit to tray
|
||||
|
||||
Reference in New Issue
Block a user