Browse Source

[Glitch] Fix refreshing featured toots when the new collection is empty

Port d34a3a2cc7 to glitch-soc
closed-social-glitch-2
Thibaut Girka 5 years ago
parent
commit
01aae33a5f
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      app/javascript/flavours/glitch/reducers/timelines.js

+ 3
- 1
app/javascript/flavours/glitch/reducers/timelines.js View File

@ -35,7 +35,9 @@ const expandNormalizedTimeline = (state, timeline, statuses, next, isPartial, is
if (!next && !isLoadingRecent) mMap.set('hasMore', false);
if (!statuses.isEmpty()) {
if (timeline.endsWith(':pinned')) {
mMap.set('items', statuses.map(status => status.get('id')));
} else if (!statuses.isEmpty()) {
mMap.update('items', ImmutableList(), oldIds => {
const newIds = statuses.map(status => status.get('id'));
const lastIndex = oldIds.findLastIndex(id => id !== null && compareId(id, newIds.last()) >= 0) + 1;

Loading…
Cancel
Save