diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2021-10-12 09:08:03 -0500 |
|---|---|---|
| committer | JP Dillingham <jpdillingham@gmail.com> | 2021-10-12 09:08:03 -0500 |
| commit | 26c134e898c65110e63dcc4254cf7693f5f096a2 (patch) | |
| tree | 3762da1c9dcb0f4663919610eb3869352a68b2ed /src/web | |
| parent | 193a050ad1ed6be9f2a0af31cf20994b4d0091bd (diff) | |
| download | slskd-26c134e898c65110e63dcc4254cf7693f5f096a2.tar.gz | |
capture options from SignalR and pass to System
Diffstat (limited to 'src/web')
| -rw-r--r-- | src/web/src/components/App.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/web/src/components/App.js b/src/web/src/components/App.js index f8813820..0eb2b6a9 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: {}, error: false, }; @@ -64,6 +65,11 @@ class App extends Component { this.setState({ applicationState: state }); }); + appHub.on('options', (options) => { + console.debug(options); + this.setState({ applicationOptions: options }); + }) + appHub.onreconnecting(() => this.setState({ error: true })); appHub.onclose(() => this.setState({ error: true })); appHub.onreconnected(() => this.setState({ error: false })); @@ -226,7 +232,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={this.state.applicationState} options={this.state.applicationOptions} />)}/> <Route path='*/' render={(props) => this.withTokenCheck(<Search {...props}/>)}/> </Switch> </Sidebar.Pusher> |
