Browse Source

Fix home timeline perpetually reloading when empty

Port 3e0ed36e8e to glitch-soc
closed-social-glitch-2
Eugen Rochko 5 years ago
committed by Thibaut Girka
parent
commit
cce1c3252f
2 changed files with 3 additions and 1 deletions
  1. +1
    -1
      app/javascript/flavours/glitch/features/home_timeline/index.js
  2. +2
    -0
      app/javascript/flavours/glitch/reducers/timelines.js

+ 1
- 1
app/javascript/flavours/glitch/features/home_timeline/index.js View File

@ -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)

+ 2
- 0
app/javascript/flavours/glitch/reducers/timelines.js View File

@ -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