From 6ce1cb432505fd222d816ddbfe04b94b241cfe58 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Tue, 16 Jul 2019 22:01:51 -0700 Subject: [PATCH] Refetch series when signalR reconnects --- frontend/src/Components/SignalRConnector.js | 5 +++++ frontend/src/Series/Index/SeriesIndexConnector.js | 8 -------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/frontend/src/Components/SignalRConnector.js b/frontend/src/Components/SignalRConnector.js index 308066567..911f95f64 100644 --- a/frontend/src/Components/SignalRConnector.js +++ b/frontend/src/Components/SignalRConnector.js @@ -9,6 +9,7 @@ import titleCase from 'Utilities/String/titleCase'; import { fetchCommands, updateCommand, finishCommand } from 'Store/Actions/commandActions'; import { setAppValue, setVersion } from 'Store/Actions/appActions'; import { update, updateItem, removeItem } from 'Store/Actions/baseActions'; +import { fetchSeries } from 'Store/Actions/seriesActions'; import { fetchHealth } from 'Store/Actions/systemActions'; import { fetchQueue, fetchQueueDetails } from 'Store/Actions/queueActions'; import { fetchRootFolders } from 'Store/Actions/rootFolderActions'; @@ -72,6 +73,7 @@ const mapDispatchToProps = { dispatchFetchQueue: fetchQueue, dispatchFetchQueueDetails: fetchQueueDetails, dispatchFetchRootFolders: fetchRootFolders, + dispatchFetchSeries: fetchSeries, dispatchFetchTags: fetchTags, dispatchFetchTagDetails: fetchTagDetails }; @@ -288,6 +290,7 @@ class SignalRConnector extends Component { const { dispatchFetchCommands, + dispatchFetchSeries, dispatchSetAppValue } = this.props; @@ -295,6 +298,7 @@ class SignalRConnector extends Component { // are in sync after reconnecting. if (this.props.isReconnecting || this.props.isDisconnected) { + dispatchFetchSeries(); dispatchFetchCommands(); repopulatePage(); } @@ -376,6 +380,7 @@ SignalRConnector.propTypes = { dispatchFetchQueue: PropTypes.func.isRequired, dispatchFetchQueueDetails: PropTypes.func.isRequired, dispatchFetchRootFolders: PropTypes.func.isRequired, + dispatchFetchSeries: PropTypes.func.isRequired, dispatchFetchTags: PropTypes.func.isRequired, dispatchFetchTagDetails: PropTypes.func.isRequired }; diff --git a/frontend/src/Series/Index/SeriesIndexConnector.js b/frontend/src/Series/Index/SeriesIndexConnector.js index d65f6a79c..e65a6444c 100644 --- a/frontend/src/Series/Index/SeriesIndexConnector.js +++ b/frontend/src/Series/Index/SeriesIndexConnector.js @@ -61,10 +61,6 @@ function createMapStateToProps() { function createMapDispatchToProps(dispatch, props) { return { - dispatchFetchSeries() { - dispatch(fetchSeries); - }, - onTableOptionChange(payload) { dispatch(setSeriesTableOption(payload)); }, @@ -114,10 +110,6 @@ class SeriesIndexConnector extends Component { }; } - componentDidMount() { - this.props.dispatchFetchSeries(); - } - // // Listeners