Svelte: follow up on display limit TODO (#62681)

This updates the svelte webapp to respect the new search.displayLimit.
This commit is contained in:
Camden Cheek 2024-05-15 09:44:05 -04:00 committed by GitHub
parent 653489c02f
commit 7e2d0bf0d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -82,7 +82,7 @@ class NonCachingStreamManager {
const streamManager = browser ? new CachingStreamManager() : new NonCachingStreamManager()
export const load: PageLoad = ({ url, depends }) => {
export const load: PageLoad = async ({ parent, url, depends }) => {
const hasQuery = url.searchParams.has('q')
const cachePolicy = getCachePolicyFromURL(url)
const trace = url.searchParams.get('trace') ?? undefined
@ -116,8 +116,7 @@ export const load: PageLoad = ({ url, depends }) => {
featureOverrides: [],
chunkMatches: true,
searchMode,
// TODO: populate this from user settings
displayLimit: 1500,
displayLimit: (await parent()).settings?.['search.displayLimit'] ?? 1500,
// 5kb is a conservative upper bound on a reasonable line to show
// to a user. In practice we can likely go much lower.
maxLineLen: 5 * 1024,