mirror of
https://github.com/ranaldsgift/KefinTweaks.git
synced 2026-11-05 15:52:47 +01:00
Fix Limits for multi-query sections
This commit is contained in:
@@ -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';
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user