diff options
| author | JP Dillingham <jp@dillingham.me> | 2023-01-30 20:41:22 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-30 20:41:22 -0600 |
| commit | 57b2584efac2548011eb59fbda61f32d5d161ee0 (patch) | |
| tree | c9db3100a1920009a20ceb59c310cc6f8296dbe5 /src/web | |
| parent | 84f75d569bef855fc1b14e4ab2c42f01eeda873d (diff) | |
| parent | 4278d95a8923178563f54fbcbb4586638921e665 (diff) | |
| download | slskd-57b2584efac2548011eb59fbda61f32d5d161ee0.tar.gz | |
Merge branch 'master' into port
Diffstat (limited to 'src/web')
| -rw-r--r-- | src/web/src/components/App.js | 77 | ||||
| -rw-r--r-- | src/web/src/components/Search/Searches.js | 2 | ||||
| -rw-r--r-- | src/web/src/components/Transfers/TransferList.js | 4 |
3 files changed, 40 insertions, 43 deletions
diff --git a/src/web/src/components/App.js b/src/web/src/components/App.js index 70d154af..b52a3bdd 100644 --- a/src/web/src/components/App.js +++ b/src/web/src/components/App.js @@ -315,50 +315,49 @@ class App extends Component { </Sidebar> <Sidebar.Pusher className='app-content'> <AppContext.Provider value={{ state: applicationState, options: applicationOptions }}> - <Switch> - {isAgent ? <> + {isAgent ? <Switch> + <Route path={`${urlBase}/system/:tab?`} render={ + (props) => this.withTokenCheck( + <System {...props} state={applicationState} options={applicationOptions} /> + ) + }/> + <Redirect from='*' to={`${urlBase}/system`}/> + </Switch> : + <Switch> + <Route path={`${urlBase}/searches/:id?`} render={(props) => + this.withTokenCheck(<div className='view'> + <Searches + server={applicationState.server} + {...props} + /> + </div>)} + /> + <Route path={`${urlBase}/browse`} render={(props) => this.withTokenCheck(<Browse {...props}/>)}/> + <Route path={`${urlBase}/users`} render={(props) => + this.withTokenCheck(<Users {...props}/>)} + /> + <Route path={`${urlBase}/chat`} render={(props) => + this.withTokenCheck(<Chat {...props} state={applicationState}/>)} + /> + <Route path={`${urlBase}/rooms`} render={(props) => this.withTokenCheck(<Rooms {...props}/>)}/> + <Route path={`${urlBase}/uploads`} render={ + (props) => + this.withTokenCheck(<div className='view'><Transfers {...props} direction='upload'/></div>) + }/> + <Route path={`${urlBase}/downloads`} render={ + (props) => + this.withTokenCheck(<div className='view'> + <Transfers {...props} direction='download' server={applicationState.server}/> + </div>) + }/> <Route path={`${urlBase}/system/:tab?`} render={ (props) => this.withTokenCheck( <System {...props} state={applicationState} options={applicationOptions} /> ) }/> - <Redirect from='*' to={`${urlBase}/system`}/> - </> : - <> - <Route path={`${urlBase}/searches/:id?`} render={(props) => - this.withTokenCheck(<div className='view'> - <Searches - server={applicationState.server} - {...props} - /> - </div>)} - /> - <Route path={`${urlBase}/browse`} render={(props) => this.withTokenCheck(<Browse {...props}/>)}/> - <Route path={`${urlBase}/users`} render={(props) => - this.withTokenCheck(<Users {...props}/>)} - /> - <Route path={`${urlBase}/chat`} render={(props) => - this.withTokenCheck(<Chat {...props} state={applicationState}/>)} - /> - <Route path={`${urlBase}/rooms`} render={(props) => this.withTokenCheck(<Rooms {...props}/>)}/> - <Route path={`${urlBase}/uploads`} render={ - (props) => - this.withTokenCheck(<div className='view'><Transfers {...props} direction='upload'/></div>) - }/> - <Route path={`${urlBase}/downloads`} render={ - (props) => - this.withTokenCheck(<div className='view'> - <Transfers {...props} direction='download' server={applicationState.server}/> - </div>) - }/> - <Route path={`${urlBase}/system/:tab?`} render={ - (props) => this.withTokenCheck( - <System {...props} state={applicationState} options={applicationOptions} /> - ) - }/> - <Redirect from='*' to={`${urlBase}/searches`}/> - </>} - </Switch> + <Redirect from='*' to={`${urlBase}/searches`}/> + </Switch> + } </AppContext.Provider> </Sidebar.Pusher> </Sidebar.Pushable> diff --git a/src/web/src/components/Search/Searches.js b/src/web/src/components/Search/Searches.js index 46a9f709..42b82f8c 100644 --- a/src/web/src/components/Search/Searches.js +++ b/src/web/src/components/Search/Searches.js @@ -42,8 +42,8 @@ const Searches = ({ server }) => { const onConnectionError = (error) => { setConnecting(false); setError(error); }; const onUpdate = (update) => { - onConnected(); setSearches(update); + onConnected(); }; useEffect(() => { diff --git a/src/web/src/components/Transfers/TransferList.js b/src/web/src/components/Transfers/TransferList.js index 0c725f98..c35f512f 100644 --- a/src/web/src/components/Transfers/TransferList.js +++ b/src/web/src/components/Transfers/TransferList.js @@ -143,9 +143,7 @@ class TransferList extends Component { </Button>} </Table.Cell> <Table.Cell className='transferlist-size'> - {f.bytesTransferred > 0 - ? formatBytesTransferred({ transferred: f.bytesTransferred, size: f.size }) - : ''} + {formatBytesTransferred({ transferred: f.bytesTransferred, size: f.size })} </Table.Cell> </Table.Row> )} |
