|
@ -31,10 +31,10 @@ const initialTimeline = ImmutableMap({ |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
const normalizeTimeline = (state, timeline, statuses, next) => { |
|
|
const normalizeTimeline = (state, timeline, statuses, next) => { |
|
|
const ids = ImmutableList(statuses.map(status => status.get('id'))); |
|
|
|
|
|
|
|
|
const oldIds = state.getIn([timeline, 'items'], ImmutableList()); |
|
|
|
|
|
const ids = ImmutableList(statuses.map(status => status.get('id'))).filter(newId => !oldIds.includes(newId)); |
|
|
const wasLoaded = state.getIn([timeline, 'loaded']); |
|
|
const wasLoaded = state.getIn([timeline, 'loaded']); |
|
|
const hadNext = state.getIn([timeline, 'next']); |
|
|
const hadNext = state.getIn([timeline, 'next']); |
|
|
const oldIds = state.getIn([timeline, 'items'], ImmutableList()); |
|
|
|
|
|
|
|
|
|
|
|
return state.update(timeline, initialTimeline, map => map.withMutations(mMap => { |
|
|
return state.update(timeline, initialTimeline, map => map.withMutations(mMap => { |
|
|
mMap.set('loaded', true); |
|
|
mMap.set('loaded', true); |
|
@ -45,8 +45,8 @@ const normalizeTimeline = (state, timeline, statuses, next) => { |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
const appendNormalizedTimeline = (state, timeline, statuses, next) => { |
|
|
const appendNormalizedTimeline = (state, timeline, statuses, next) => { |
|
|
const ids = ImmutableList(statuses.map(status => status.get('id'))); |
|
|
|
|
|
const oldIds = state.getIn([timeline, 'items'], ImmutableList()); |
|
|
const oldIds = state.getIn([timeline, 'items'], ImmutableList()); |
|
|
|
|
|
const ids = ImmutableList(statuses.map(status => status.get('id'))).filter(newId => !oldIds.includes(newId)); |
|
|
|
|
|
|
|
|
return state.update(timeline, initialTimeline, map => map.withMutations(mMap => { |
|
|
return state.update(timeline, initialTimeline, map => map.withMutations(mMap => { |
|
|
mMap.set('isLoading', false); |
|
|
mMap.set('isLoading', false); |
|
|