]> cat aescling's git repositories - mastodon.git/commitdiff
Fix home timeline perpetually reloading when empty
authorEugen Rochko <eugen@zeonfederated.com>
Fri, 1 Mar 2019 10:11:35 +0000 (11:11 +0100)
committerThibaut Girka <thib@sitedethib.com>
Tue, 5 Mar 2019 18:30:11 +0000 (19:30 +0100)
Port 3e0ed36e8ede7f1994ab9c46c4cb86e613569440 to glitch-soc

app/javascript/flavours/glitch/features/home_timeline/index.js
app/javascript/flavours/glitch/reducers/timelines.js

index 7d124ba01f07607fe9aa0c3a63b045afed00683d..8eb79fa60d6f77964fa8249b66fa2940609635b6 100644 (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)
index d7d5ac43fe728d3d4ae64d92c8ba69a2bf6997ef..4179cf4771cd1e561cbce6a8a2146f5e318420f2 100644 (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()) {