Skip to content

Commit

Permalink
Fix home timeline perpetually reloading when empty (mastodon#10130)
Browse files Browse the repository at this point in the history
Regression from mastodon#6876
  • Loading branch information
Gargron authored Mar 1, 2019
1 parent fef1931 commit 6c01d6d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/javascript/mastodon/features/home_timeline/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']),
});

export default @connect(mapStateToProps)
Expand Down
2 changes: 2 additions & 0 deletions app/javascript/mastodon/reducers/timelines.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down

0 comments on commit 6c01d6d

Please sign in to comment.