Skip to content

Commit

Permalink
fix(frontend/settings): server and other partially dynamic settings
Browse files Browse the repository at this point in the history
related to 223df6e

Co-Authored-By: Harjot Singh <contact@harjot.me>
  • Loading branch information
saihaj and Harjot1Singh committed May 15, 2020
1 parent 2a8313d commit 5da6dae
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions app/frontend/src/Settings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import {
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faBars, faWindowMaximize, faInfo } from '@fortawesome/free-solid-svg-icons'

import controller from '../lib/controller'
import {
BACKEND_URL,
SETTINGS_URL,
Expand Down Expand Up @@ -204,7 +203,6 @@ const Settings = () => {
const { theme: { themeName } = {}, hotkeys } = selectedDeviceSettings

const defaultUrl = `${SETTINGS_DEVICE_URL}/${Object.keys( selectedDeviceSettings )[ 0 ]}`
const setSettings = settings => controller.setSettings( settings, device )

return (
<div className={classNames( { simple: simpleGraphics }, 'settings' )}>
Expand All @@ -222,15 +220,15 @@ const Settings = () => {
path={`${SETTINGS_DEVICE_URL}/hotkeys`}
render={() => ( <Hotkeys shortcuts={SHORTCUTS} keys={hotkeys} device={device} /> )}
/>
<Route path={`${SETTINGS_DEVICE_URL}/sources`} render={() => <Sources sources={selectedDeviceSettings.sources} setSettings={setSettings} />} />
<Route path={`${SETTINGS_DEVICE_URL}/*`} render={() => <DynamicOptions device={device} group={group} onChange={setSettings} />} />
<Route path={`${SETTINGS_DEVICE_URL}/sources`} render={() => <Sources sources={selectedDeviceSettings.sources} />} />
<Route path={`${SETTINGS_DEVICE_URL}/*`} render={() => <DynamicOptions device={device} group={group} />} />

{/* Server setting routes */}
<Route
path={SETTINGS_ABOUT_URL}
render={() => <About connected={Object.keys( settings ).length - 1} />}
/>
<Route path={`${SETTINGS_SERVER_URL}/*`} render={() => <DynamicOptions device="global" group={group} onChange={setSettings} />} />
<Route path={`${SETTINGS_SERVER_URL}/*`} render={() => <DynamicOptions device="global" group={group} />} />

{/* Tool Routes */}
<Route path={SETTINGS_OVERLAY_URL} component={OverlaySettings} />
Expand Down

0 comments on commit 5da6dae

Please sign in to comment.