Fixed: App command status not showing in UI (No Spin)

This commit is contained in:
Qstick
2021-02-28 02:11:26 -05:00
parent b870f96ec8
commit 59e30805a2
4 changed files with 29 additions and 58 deletions
@@ -2,9 +2,7 @@ import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import * as commandNames from 'Commands/commandNames';
import { executeCommand } from 'Store/Actions/commandActions';
import createExecutingCommandsSelector from 'Store/Selectors/createExecutingCommandsSelector';
import createIndexerSelector from 'Store/Selectors/createIndexerSelector';
import createIndexerStatusSelector from 'Store/Selectors/createIndexerStatusSelector';
import createUISettingsSelector from 'Store/Selectors/createUISettingsSelector';
@@ -23,13 +21,11 @@ function createMapStateToProps() {
createIndexerSelector(),
createIndexerStatusSelector(),
selectShowSearchAction(),
createExecutingCommandsSelector(),
createUISettingsSelector(),
(
movie,
status,
showSearchAction,
executingCommands,
uiSettings
) => {
@@ -42,26 +38,10 @@ function createMapStateToProps() {
return {};
}
const isRefreshingMovie = executingCommands.some((command) => {
return (
command.name === commandNames.REFRESH_MOVIE &&
command.body.movieIds.includes(movie.id)
);
});
const isSearchingMovie = executingCommands.some((command) => {
return (
command.name === commandNames.MOVIE_SEARCH &&
command.body.movieIds.includes(movie.id)
);
});
return {
...movie,
status,
showSearchAction,
isRefreshingMovie,
isSearchingMovie,
longDateFormat: uiSettings.longDateFormat,
timeFormat: uiSettings.timeFormat
};
@@ -75,23 +55,6 @@ const mapDispatchToProps = {
class MovieIndexItemConnector extends Component {
//
// Listeners
onRefreshMoviePress = () => {
this.props.dispatchExecuteCommand({
name: commandNames.REFRESH_MOVIE,
movieIds: [this.props.id]
});
}
onSearchPress = () => {
this.props.dispatchExecuteCommand({
name: commandNames.MOVIE_SEARCH,
movieIds: [this.props.id]
});
}
//
// Render
@@ -110,8 +73,6 @@ class MovieIndexItemConnector extends Component {
<ItemComponent
{...otherProps}
id={id}
onRefreshMoviePress={this.onRefreshMoviePress}
onSearchPress={this.onSearchPress}
/>
);
}