Fixed: Queue/History take two clicks to load, We don't wait on Episode Fetch

pull/2/head
Qstick 5 years ago
parent b6c1c81152
commit 2758adcc8c

@ -1,7 +1,6 @@
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { align, icons } from 'Helpers/Props';
import hasDifferentItems from 'Utilities/Object/hasDifferentItems';
import LoadingIndicator from 'Components/Loading/LoadingIndicator';
import Table from 'Components/Table/Table';
import TableBody from 'Components/Table/TableBody';
@ -17,26 +16,6 @@ import HistoryRowConnector from './HistoryRowConnector';
class History extends Component {
//
// Lifecycle
shouldComponentUpdate(nextProps) {
// Don't update when fetching has completed if items have changed,
// before episodes start fetching or when episodes start fetching.
if (
(
this.props.isFetching &&
nextProps.isPopulated &&
hasDifferentItems(this.props.items, nextProps.items)
)
) {
return false;
}
return true;
}
//
// Render

@ -40,22 +40,6 @@ class Queue extends Component {
};
}
shouldComponentUpdate(nextProps) {
// Don't update when fetching has completed if items have changed,
// before movies start fetching or when movies start fetching.
if (
this.props.isFetching &&
nextProps.isPopulated &&
hasDifferentItems(this.props.items, nextProps.items) &&
nextProps.items.some((e) => e.movieId)
) {
return false;
}
return true;
}
componentDidUpdate(prevProps) {
if (hasDifferentItems(prevProps.items, this.props.items)) {
this.setState((state) => {

Loading…
Cancel
Save