diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2021-12-16 08:44:23 -0600 |
|---|---|---|
| committer | JP Dillingham <jpdillingham@gmail.com> | 2021-12-16 08:44:23 -0600 |
| commit | fe2c70a59b9a59ac64bdbad45eccef7da28ce1c6 (patch) | |
| tree | 435f9f6fa0f64049497fe113d7cfbd0d531d41a3 /src | |
| parent | 7ba18819b0faca33ee8dc865c429b495eb3ef6f9 (diff) | |
| download | slskd-fe2c70a59b9a59ac64bdbad45eccef7da28ce1c6.tar.gz | |
display inert buttons for uploads, don't react to clicks
Diffstat (limited to 'src')
| -rw-r--r-- | src/web/src/components/Transfers/TransferList.js | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/web/src/components/Transfers/TransferList.js b/src/web/src/components/Transfers/TransferList.js index 741dc907..f1538570 100644 --- a/src/web/src/components/Transfers/TransferList.js +++ b/src/web/src/components/Transfers/TransferList.js @@ -31,19 +31,21 @@ const getColor = (state) => { } } -const isRetryable = (state) => getColor(state).color === 'red'; +const isRetryableState = (state) => getColor(state).color === 'red'; class TransferList extends Component { handleClick = (file) => { - const { state } = file; - - if (isRetryable(state)) { - return this.props.onRetryRequested(file); - } + const { state, direction } = file; - if (state === 'Queued') { - return this.props.onPlaceInQueueRequested(file); - } + if (direction === 'Download') { + if (isRetryableState(state)) { + return this.props.onRetryRequested(file); + } + + if (state === 'Queued') { + return this.props.onPlaceInQueueRequested(file); + } + } } render = () => { @@ -95,12 +97,13 @@ class TransferList extends Component { <Button fluid size='mini' - style={{ margin: 0, padding: 7 }} + style={{ margin: 0, padding: 7, cursor: f.direction === 'Upload' ? 'unset' : '' }} {...getColor(f.state)} onClick={() => this.handleClick(f)} + active={f.direction === 'Upload'} > - {f.state === 'Queued' && <Icon name='refresh'/>} - {isRetryable(f.state) && <Icon name='redo'/>} + {f.direction === 'Download' && f.state === 'Queued' && <Icon name='refresh'/>} + {f.direction === 'Download' && isRetryableState(f.state) && <Icon name='redo'/>} {f.state}{f.placeInQueue ? ` (#${f.placeInQueue})` : ''} </Button>} </Table.Cell> |
