Skip to content

Commit 2c1bb7d

Browse files
ClearlyClaireGargron
authored andcommitted
Fix refreshing featured toots when the new collection is empty (mastodon#10971)
Fixes mastodon#10945
1 parent c742210 commit 2c1bb7d

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

app/javascript/mastodon/reducers/timelines.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,12 @@ const expandNormalizedTimeline = (state, timeline, statuses, next, isPartial, is
3535

3636
if (!next && !isLoadingRecent) mMap.set('hasMore', false);
3737

38-
if (!statuses.isEmpty()) {
38+
if (timeline.endsWith(':pinned')) {
39+
mMap.set('items', statuses.map(status => status.get('id')));
40+
} else if (!statuses.isEmpty()) {
3941
mMap.update('items', ImmutableList(), oldIds => {
4042
const newIds = statuses.map(status => status.get('id'));
4143

42-
if (timeline.indexOf(':pinned') !== -1) {
43-
return newIds;
44-
}
45-
4644
const lastIndex = oldIds.findLastIndex(id => id !== null && compareId(id, newIds.last()) >= 0) + 1;
4745
const firstIndex = oldIds.take(lastIndex).findLastIndex(id => id !== null && compareId(id, newIds.first()) > 0);
4846

0 commit comments

Comments
 (0)