diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2021-10-18 07:24:36 -0500 |
|---|---|---|
| committer | JP Dillingham <jpdillingham@gmail.com> | 2021-10-18 07:24:36 -0500 |
| commit | 5424002f109c6be3f4355170e36ba500bf7f067b (patch) | |
| tree | 7de4620d33fb841b923473361e2fd0b49bb187d1 /src | |
| parent | f2213488b3eaabea38e1f5859974952708cdd300 (diff) | |
| download | slskd-5424002f109c6be3f4355170e36ba500bf7f067b.tar.gz | |
map options to System component
Diffstat (limited to 'src')
| -rw-r--r-- | src/web/src/components/App.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/web/src/components/App.js b/src/web/src/components/App.js index d298de31..cd80774f 100644 --- a/src/web/src/components/App.js +++ b/src/web/src/components/App.js @@ -34,6 +34,7 @@ const initialState = { error: undefined }, applicationState: {}, + applicationOptions: {}, initialized: false, error: false, retriesExhausted: false, @@ -61,6 +62,10 @@ class App extends Component { appHub.on('state', (state) => { this.setState({ applicationState: state }); }); + + appHub.on('options', (options) => { + this.setState({ applicationOptions: options }) + }) appHub.onreconnecting(() => this.setState({ error: true, retriesExhausted: false })); appHub.onclose(() => this.setState({ error: true, retriesExhausted: true })); @@ -102,7 +107,7 @@ class App extends Component { }; render = () => { - const { login, applicationState = {}, error, initialized, retriesExhausted } = this.state; + const { login, applicationState = {}, applicationOptions = {}, error, initialized, retriesExhausted } = this.state; const { version = {}, server } = applicationState; const { isUpdateAvailable, current, latest } = version; @@ -237,7 +242,7 @@ class App extends Component { <Route path='*/rooms' render={(props) => this.withTokenCheck(<Rooms {...props}/>)}/> <Route path='*/uploads' render={(props) => this.withTokenCheck(<Transfers {...props} direction='upload'/>)}/> <Route path='*/downloads' render={(props) => this.withTokenCheck(<Transfers {...props} direction='download'/>)}/> - <Route path='*/system' render={(props) => this.withTokenCheck(<System state={this.state.applicationState}/>)}/> + <Route path='*/system' render={(props) => this.withTokenCheck(<System state={applicationState} options={applicationOptions}/>)}/> <Route path='*/' render={(props) => this.withTokenCheck(<Search {...props}/>)}/> </Switch> </Sidebar.Pusher> |
