From f5d6a7999885928c2bccde2bdb50c3be1b1e48d5 Mon Sep 17 00:00:00 2001 From: Qstick Date: Mon, 5 Dec 2022 21:12:11 -0600 Subject: [PATCH] Fixed: Grab/remove queue actions not showing spinner Fixes #7821 --- frontend/src/Activity/Queue/Queue.js | 32 ++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/frontend/src/Activity/Queue/Queue.js b/frontend/src/Activity/Queue/Queue.js index 77ba1ba62..98382d265 100644 --- a/frontend/src/Activity/Queue/Queue.js +++ b/frontend/src/Activity/Queue/Queue.js @@ -75,13 +75,23 @@ class Queue extends Component { return; } + const nextState = {}; + + if (prevProps.items !== items) { + nextState.items = items; + } + const selectedIds = this.getSelectedIds(); const isPendingSelected = _.some(this.props.items, (item) => { return selectedIds.indexOf(item.id) > -1 && item.status === 'delay'; }); if (isPendingSelected !== this.state.isPendingSelected) { - this.setState({ isPendingSelected }); + nextState.isPendingSelected = isPendingSelected; + } + + if (!_.isEmpty(nextState)) { + this.setState(nextState); } } @@ -214,26 +224,29 @@ class Queue extends Component { { - isRefreshing && !isAllPopulated && - + isRefreshing && !isAllPopulated ? + : + null } { - !isRefreshing && hasError && + !isRefreshing && hasError ?
{translate('FailedToLoadQueue')} -
+ : + null } { - isAllPopulated && !hasError && !items.length && + isAllPopulated && !hasError && !items.length ?
{translate('QueueIsEmpty')} -
+ : + null } { - isAllPopulated && !hasError && !!items.length && + isAllPopulated && !hasError && !!items.length ?
- + : + null }