Add Page Populator from Sonarr

This commit is contained in:
Qstick 2017-10-07 02:47:28 -04:00
parent 52e3d96f4a
commit 023452e1c3
12 changed files with 244 additions and 69 deletions

View file

@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import { registerPagePopulator, unregisterPagePopulator } from 'Utilities/pagePopulator';
import hasDifferentItems from 'Utilities/Object/hasDifferentItems';
import selectUniqueIds from 'Utilities/Object/selectUniqueIds';
import createCommandsSelector from 'Store/Selectors/createCommandsSelector';
@ -44,6 +45,7 @@ class QueueConnector extends Component {
// Lifecycle
componentDidMount() {
registerPagePopulator(this.repopulate);
this.props.gotoQueueFirstPage();
}
@ -56,10 +58,18 @@ class QueueConnector extends Component {
}
componentWillUnmount() {
unregisterPagePopulator(this.repopulate);
this.props.clearQueue();
this.props.clearEpisodes();
}
//
// Control
repopulate = () => {
this.props.fetchQueue();
}
//
// Listeners