Skip to content

Commit

Permalink
Fix onboarding prompt being displayed because of disconnection gaps (m…
Browse files Browse the repository at this point in the history
  • Loading branch information
ClearlyClaire authored Jun 30, 2023
1 parent 8bfbd19 commit 9934949
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/javascript/mastodon/features/home_timeline/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const getHomeFeedSpeed = createSelector([
state => state.get('statuses'),
], (statusIds, pendingStatusIds, statusMap) => {
const recentStatusIds = pendingStatusIds.size > 0 ? pendingStatusIds : statusIds;
const statuses = recentStatusIds.map(id => statusMap.get(id)).filter(status => status?.get('account') !== me).take(20);
const statuses = recentStatusIds.filter(id => id !== null).map(id => statusMap.get(id)).filter(status => status?.get('account') !== me).take(20);
const oldest = new Date(statuses.getIn([statuses.size - 1, 'created_at'], 0));
const newest = new Date(statuses.getIn([0, 'created_at'], 0));
const averageGap = (newest - oldest) / (1000 * (statuses.size + 1)); // Average gap between posts on first page in seconds
Expand Down

0 comments on commit 9934949

Please sign in to comment.