|
|
@ -1,6 +1,7 @@
|
|
|
|
import _ from 'lodash';
|
|
|
|
import _ from 'lodash';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
|
|
|
|
import getRemovedItems from 'Utilities/Object/getRemovedItems';
|
|
|
|
import hasDifferentItems from 'Utilities/Object/hasDifferentItems';
|
|
|
|
import hasDifferentItems from 'Utilities/Object/hasDifferentItems';
|
|
|
|
import getSelectedIds from 'Utilities/Table/getSelectedIds';
|
|
|
|
import getSelectedIds from 'Utilities/Table/getSelectedIds';
|
|
|
|
import removeOldSelectedState from 'Utilities/Table/removeOldSelectedState';
|
|
|
|
import removeOldSelectedState from 'Utilities/Table/removeOldSelectedState';
|
|
|
@ -36,14 +37,22 @@ class Queue extends Component {
|
|
|
|
lastToggled: null,
|
|
|
|
lastToggled: null,
|
|
|
|
selectedState: {},
|
|
|
|
selectedState: {},
|
|
|
|
isPendingSelected: false,
|
|
|
|
isPendingSelected: false,
|
|
|
|
isConfirmRemoveModalOpen: false
|
|
|
|
isConfirmRemoveModalOpen: false,
|
|
|
|
|
|
|
|
items: props.items
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
componentDidUpdate(prevProps) {
|
|
|
|
componentDidUpdate(prevProps) {
|
|
|
|
if (hasDifferentItems(prevProps.items, this.props.items)) {
|
|
|
|
const {
|
|
|
|
|
|
|
|
items
|
|
|
|
|
|
|
|
} = this.props;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (hasDifferentItems(prevProps.items, items) && !items.some((e) => e.movieId)) {
|
|
|
|
this.setState((state) => {
|
|
|
|
this.setState((state) => {
|
|
|
|
return removeOldSelectedState(state, prevProps.items);
|
|
|
|
return {
|
|
|
|
|
|
|
|
...removeOldSelectedState(state, getRemovedItems(prevProps.items, items)),
|
|
|
|
|
|
|
|
items
|
|
|
|
|
|
|
|
};
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -107,7 +116,6 @@ class Queue extends Component {
|
|
|
|
isMoviesFetching,
|
|
|
|
isMoviesFetching,
|
|
|
|
isMoviesPopulated,
|
|
|
|
isMoviesPopulated,
|
|
|
|
moviesError,
|
|
|
|
moviesError,
|
|
|
|
items,
|
|
|
|
|
|
|
|
columns,
|
|
|
|
columns,
|
|
|
|
totalRecords,
|
|
|
|
totalRecords,
|
|
|
|
isGrabbing,
|
|
|
|
isGrabbing,
|
|
|
@ -122,7 +130,8 @@ class Queue extends Component {
|
|
|
|
allUnselected,
|
|
|
|
allUnselected,
|
|
|
|
selectedState,
|
|
|
|
selectedState,
|
|
|
|
isConfirmRemoveModalOpen,
|
|
|
|
isConfirmRemoveModalOpen,
|
|
|
|
isPendingSelected
|
|
|
|
isPendingSelected,
|
|
|
|
|
|
|
|
items
|
|
|
|
} = this.state;
|
|
|
|
} = this.state;
|
|
|
|
|
|
|
|
|
|
|
|
const isRefreshing = isFetching || isMoviesFetching || isRefreshMonitoredDownloadsExecuting;
|
|
|
|
const isRefreshing = isFetching || isMoviesFetching || isRefreshMonitoredDownloadsExecuting;
|
|
|
|