From 2758adcc8cf8f27183fcfe856b7367c62359d6b7 Mon Sep 17 00:00:00 2001 From: Qstick Date: Thu, 25 Jul 2019 22:52:03 -0400 Subject: [PATCH] Fixed: Queue/History take two clicks to load, We don't wait on Episode Fetch --- frontend/src/Activity/History/History.js | 21 --------------------- frontend/src/Activity/Queue/Queue.js | 16 ---------------- 2 files changed, 37 deletions(-) diff --git a/frontend/src/Activity/History/History.js b/frontend/src/Activity/History/History.js index 2d18a5e6a..e5ab7f830 100644 --- a/frontend/src/Activity/History/History.js +++ b/frontend/src/Activity/History/History.js @@ -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 diff --git a/frontend/src/Activity/Queue/Queue.js b/frontend/src/Activity/Queue/Queue.js index fff12b154..0ddcd2e8c 100644 --- a/frontend/src/Activity/Queue/Queue.js +++ b/frontend/src/Activity/Queue/Queue.js @@ -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) => {