Selaa lähdekoodia

Fix home timeline perpetually reloading when empty (#10130)

Regression from #6876
master
Eugen Rochko 5 vuotta sitten
committed by GitHub
vanhempi
commit
3e0ed36e8e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 muutettua tiedostoa jossa 3 lisäystä ja 1 poistoa
  1. +1
    -1
      app/javascript/mastodon/features/home_timeline/index.js
  2. +2
    -0
      app/javascript/mastodon/reducers/timelines.js

+ 1
- 1
app/javascript/mastodon/features/home_timeline/index.js Näytä tiedosto

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


+ 2
- 0
app/javascript/mastodon/reducers/timelines.js Näytä tiedosto

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


Ladataan…
Peruuta
Tallenna