From 490e42015b192df4bd417d18ad49fc378733a07f Mon Sep 17 00:00:00 2001 From: Qstick Date: Fri, 1 Nov 2019 13:38:28 -0400 Subject: [PATCH] Fixed: Album search indicator spins forever if any task exists --- frontend/src/Album/Details/AlbumDetailsConnector.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/Album/Details/AlbumDetailsConnector.js b/frontend/src/Album/Details/AlbumDetailsConnector.js index 3bcbfd06b..12a7c94b7 100644 --- a/frontend/src/Album/Details/AlbumDetailsConnector.js +++ b/frontend/src/Album/Details/AlbumDetailsConnector.js @@ -4,7 +4,7 @@ import PropTypes from 'prop-types'; import React, { Component } from 'react'; import { connect } from 'react-redux'; import { createSelector } from 'reselect'; -import { findCommand } from 'Utilities/Command'; +import { findCommand, isCommandExecuting } from 'Utilities/Command'; import { registerPagePopulator, unregisterPagePopulator } from 'Utilities/pagePopulator'; import createCommandsSelector from 'Store/Selectors/createCommandsSelector'; import { toggleAlbumsMonitored } from 'Store/Actions/albumActions'; @@ -65,7 +65,11 @@ function createMapStateToProps() { const previousAlbum = sortedAlbums[albumIndex - 1] || _.last(sortedAlbums); const nextAlbum = sortedAlbums[albumIndex + 1] || _.first(sortedAlbums); - const isSearching = !!findCommand(commands, { name: commandNames.ALBUM_SEARCH }); + const isSearchingCommand = findCommand(commands, { name: commandNames.ALBUM_SEARCH }); + const isSearching = ( + isCommandExecuting(isSearchingCommand) && + isSearchingCommand.body.albumIds.indexOf(album.id) > -1 + ); const isFetching = tracks.isFetching || isTrackFilesFetching; const isPopulated = tracks.isPopulated && isTrackFilesPopulated;