diff --git a/lib/manager/actions/status.js b/lib/manager/actions/status.js index e53eec23e..87fe75a45 100644 --- a/lib/manager/actions/status.js +++ b/lib/manager/actions/status.js @@ -1,6 +1,7 @@ // @flow import moment from 'moment' +import { browserHistory } from 'react-router' import { createAction, type ActionType } from 'redux-actions' import { createVoidPayloadAction, secureFetch } from '../../common/actions' @@ -259,6 +260,17 @@ export function handleFinishedJob (job: ServerJob) { } } break + case 'PROCESS_FEED': + // If viewing a particular feed, navigate to a new feed version as soon as it becomes available. + // It is the same path (without version number) as the link shown for this job status. + // (If user is not looking at this feed, don't navigate away from their current page.) + if (job.feedSourceId) { + const newVersionPath = `/feed/${job.feedSourceId}` + if (browserHistory.getCurrentLocation().pathname.startsWith(newVersionPath)) { + browserHistory.push(newVersionPath) + } + } + break default: console.warn(`No completion step defined for job type ${job.type}`) break diff --git a/lib/manager/actions/versions.js b/lib/manager/actions/versions.js index ccfe12835..ad29d8ac1 100644 --- a/lib/manager/actions/versions.js +++ b/lib/manager/actions/versions.js @@ -162,7 +162,7 @@ export function publishFeedVersion (feedVersion: FeedVersion) { } /** - * Merges two feed versions according to the strategy defined within the + * Merges two feed versions according to the strategy defined by the mergeType parameter. */ export function mergeVersions (targetVersionId: string, versionId: string, mergeType: 'SERVICE_PERIOD' | 'REGIONAL') { return function (dispatch: dispatchFn, getState: getStateFn) {