Skip to content

Commit

Permalink
Limit prefetching to 200 items
Browse files Browse the repository at this point in the history
  • Loading branch information
Ceylo committed Dec 18, 2024
1 parent bc7ca54 commit 1a143d8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion FurAffinity/User/UserGalleryLikeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ struct UserGalleryLikeView: View {
logger.error("Skipping prefetch due to too small geometry: \(String(describing: geometry.size))")
return
}
let previews = filteredPreviews
// When user cancels search, the list can contain several thousands of previews.
// It's unlikely that they will scroll down this much. And if they do, avatars
// and thumbnails will download on the fly. Less optimal experience but still fine.
let previews = Array(filteredPreviews.prefix(200))
prefetchThumbnails(for: previews, availableWidth: thumbnailsWidth)
prefetchAvatars(for: previews)
}
Expand Down

0 comments on commit 1a143d8

Please sign in to comment.