File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 11// @flow
22
33import moment from 'moment'
4+ import { browserHistory } from 'react-router'
45import { createAction , type ActionType } from 'redux-actions'
56
67import { createVoidPayloadAction , secureFetch } from '../../common/actions'
@@ -259,6 +260,17 @@ export function handleFinishedJob (job: ServerJob) {
259260 }
260261 }
261262 break
263+ case 'PROCESS_FEED' :
264+ // If viewing a particular feed, navigate to a new feed version as soon as it becomes available.
265+ // It is the same path (without version number) as the link shown for this job status.
266+ // (If user is not looking at this feed, don't navigate away from their current page.)
267+ if ( job . feedSourceId ) {
268+ const newVersionPath = `/feed/${ job . feedSourceId } `
269+ if ( browserHistory . getCurrentLocation ( ) . pathname . startsWith ( newVersionPath ) ) {
270+ browserHistory . push ( newVersionPath )
271+ }
272+ }
273+ break
262274 default :
263275 console . warn ( `No completion step defined for job type ${ job . type } ` )
264276 break
Original file line number Diff line number Diff line change @@ -162,7 +162,7 @@ export function publishFeedVersion (feedVersion: FeedVersion) {
162162}
163163
164164/**
165- * Merges two feed versions according to the strategy defined within the
165+ * Merges two feed versions according to the strategy defined by the mergeType parameter.
166166 */
167167export function mergeVersions (targetVersionId: string, versionId: string, mergeType: 'SERVICE_PERIOD' | 'REGIONAL') {
168168 return function (dispatch: dispatchFn, getState: getStateFn) {
You can’t perform that action at this time.
0 commit comments