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 1
1
// @flow
2
2
3
3
import moment from 'moment'
4
+ import { browserHistory } from 'react-router'
4
5
import { createAction , type ActionType } from 'redux-actions'
5
6
6
7
import { createVoidPayloadAction , secureFetch } from '../../common/actions'
@@ -259,6 +260,17 @@ export function handleFinishedJob (job: ServerJob) {
259
260
}
260
261
}
261
262
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
262
274
default :
263
275
console . warn ( `No completion step defined for job type ${ job . type } ` )
264
276
break
Original file line number Diff line number Diff line change @@ -162,7 +162,7 @@ export function publishFeedVersion (feedVersion: FeedVersion) {
162
162
}
163
163
164
164
/**
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.
166
166
*/
167
167
export function mergeVersions (targetVersionId: string, versionId: string, mergeType: 'SERVICE_PERIOD' | 'REGIONAL') {
168
168
return function (dispatch: dispatchFn, getState: getStateFn) {
You can’t perform that action at this time.
0 commit comments