aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2022-03-05 22:40:05 -0600
committerGitHub <noreply@github.com>2022-03-05 22:40:05 -0600
commit56b789e6cf869bdbd79b4f48cff017b21e5decb4 (patch)
treef9a786df57d88dfc6035daab726210b39c684eee /src
parent7289f55e6bf9b752411fbcc891cb1cbd96cb55cc (diff)
parentb7c24802a75e97d61ec54207565b5b7cb27fe935 (diff)
downloadslskd-56b789e6cf869bdbd79b4f48cff017b21e5decb4.tar.gz
Merge pull request #383 from slskd/queued
Update UI to display newer queued states
Diffstat (limited to 'src')
-rw-r--r--src/web/src/components/Transfers/TransferGroup.js2
-rw-r--r--src/web/src/components/Transfers/TransferList.js7
2 files changed, 6 insertions, 3 deletions
diff --git a/src/web/src/components/Transfers/TransferGroup.js b/src/web/src/components/Transfers/TransferGroup.js
index c8675be8..371f0418 100644
--- a/src/web/src/components/Transfers/TransferGroup.js
+++ b/src/web/src/components/Transfers/TransferGroup.js
@@ -47,7 +47,7 @@ class TransferGroup extends Component {
}
isStateRetryable = (state) => this.props.direction === 'download' && state.includes('Completed') && state !== 'Completed, Succeeded';
- isStateCancellable = (state) => ['InProgress', 'Requested', 'Queued', 'Initializing'].find(s => s === state);
+ isStateCancellable = (state) => ['InProgress', 'Requested', 'Queued', 'Queued, Remotely', 'Queued, Locally', 'Initializing'].find(s => s === state);
isStateRemovable = (state) => state.includes('Completed');
retryAll = async (selected) => {
diff --git a/src/web/src/components/Transfers/TransferList.js b/src/web/src/components/Transfers/TransferList.js
index f1538570..11ffbc3e 100644
--- a/src/web/src/components/Transfers/TransferList.js
+++ b/src/web/src/components/Transfers/TransferList.js
@@ -22,6 +22,8 @@ const getColor = (state) => {
case 'Completed, Succeeded':
return { color: 'green' };
case 'Requested':
+ case 'Queued, Locally':
+ case 'Queued, Remotely':
case 'Queued':
return {};
case 'Initializing':
@@ -32,6 +34,7 @@ const getColor = (state) => {
}
const isRetryableState = (state) => getColor(state).color === 'red';
+const isQueuedState = (state) => state.includes('Queued');
class TransferList extends Component {
handleClick = (file) => {
@@ -42,7 +45,7 @@ class TransferList extends Component {
return this.props.onRetryRequested(file);
}
- if (state === 'Queued') {
+ if (isQueuedState(state)) {
return this.props.onPlaceInQueueRequested(file);
}
}
@@ -102,7 +105,7 @@ class TransferList extends Component {
onClick={() => this.handleClick(f)}
active={f.direction === 'Upload'}
>
- {f.direction === 'Download' && f.state === 'Queued' && <Icon name='refresh'/>}
+ {f.direction === 'Download' && isQueuedState(f.state) && <Icon name='refresh'/>}
{f.direction === 'Download' && isRetryableState(f.state) && <Icon name='redo'/>}
{f.state}{f.placeInQueue ? ` (#${f.placeInQueue})` : ''}
</Button>}