Skip to content

Commit eb648f9

Browse files
fix(manager/actions/status): Navigate to latest feed ver. after processing complete.
1 parent efeae58 commit eb648f9

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

lib/manager/actions/status.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// @flow
22

33
import moment from 'moment'
4+
import { browserHistory } from 'react-router'
45
import { createAction, type ActionType } from 'redux-actions'
56

67
import { 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

lib/manager/actions/versions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
*/
167167
export function mergeVersions (targetVersionId: string, versionId: string, mergeType: 'SERVICE_PERIOD' | 'REGIONAL') {
168168
return function (dispatch: dispatchFn, getState: getStateFn) {

0 commit comments

Comments
 (0)