~cytrogen/masto-fe

9934949fc4c0a019fc7c7d0e7bdd6e68d496a861 — Claire 2 years ago 8bfbd19
Fix onboarding prompt being displayed because of disconnection gaps (#25617)

1 files changed, 1 insertions(+), 1 deletions(-)

M app/javascript/mastodon/features/home_timeline/index.jsx
M app/javascript/mastodon/features/home_timeline/index.jsx => app/javascript/mastodon/features/home_timeline/index.jsx +1 -1
@@ 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