Fix home timeline perpetually reloading when empty

Port 0c8d1435c5 to glitch-soc
th-downstream
Eugen Rochko 6 years ago committed by Thibaut Girka
parent c0b876f726
commit 0dc5c2a4a5

@ -16,7 +16,7 @@ const messages = defineMessages({
const mapStateToProps = state => ({
hasUnread: state.getIn(['timelines', 'home', 'unread']) > 0,
isPartial: state.getIn(['timelines', 'home', 'items', 0], null) === null,
isPartial: state.getIn(['timelines', 'home', 'isPartial']),
});
@connect(mapStateToProps)

@ -29,6 +29,8 @@ const initialTimeline = ImmutableMap({
const expandNormalizedTimeline = (state, timeline, statuses, next, isPartial, isLoadingRecent) => {
return state.update(timeline, initialTimeline, map => map.withMutations(mMap => {
mMap.set('isLoading', false);
mMap.set('isPartial', isPartial);
if (!next && !isLoadingRecent) mMap.set('hasMore', false);
if (!statuses.isEmpty()) {

Loading…
Cancel
Save