Fix Limits for multi-query sections

This commit is contained in:
HighImKevin
2026-10-21 15:18:05 -04:00
parent adfc690af2
commit 706c3f1d3a
2 changed files with 4 additions and 4 deletions
+1 -3
View File
@@ -6129,13 +6129,11 @@ window.KefinTweaksConfig = ${JSON.stringify(configToBackup, null, 2)};`;
return { items: [], limit: 0, section: previewSection };
}
const limit = previewSection.itemLimit
|| withPreviewQueryOptions(queriesToLoad[0]).queryOptions.Limit
|| PREVIEW_DEFAULT_LIMIT;
allItems = window.cardBuilder.postProcessItems(previewSection, allItems);
const limitedItems = allItems.slice(0, parseInt(limit, 10));
return { items: limitedItems, limit: parseInt(limit, 10), section: previewSection };
return { items: allItems, limit: 0, section: previewSection };
}
const EDITOR_PREVIEW_SECTION_ID = 'hsae-editor-preview';
+3 -1
View File
@@ -1130,7 +1130,9 @@
});
}
const limit = sectionConfig.itemLimit || sectionConfig.queries?.[0]?.queryOptions?.Limit || 0;
// Sum of all query limits
const totalLimit = sectionConfig.queries?.reduce((acc, query) => acc + (query.queryOptions?.Limit || 0), 0);
const limit = sectionConfig.itemLimit || totalLimit || 0;
if (sectionConfig.queries?.[0]?.queryOptions?.SortBy === 'Random' || sectionConfig.sortBy === 'Random') {
if (limit > 0 && sectionConfig.limitBeforeSort === true) {