Overview should also use calculated equivalent counts
This commit is contained in:
+13
-2
@@ -495,6 +495,17 @@ local function getEquivalentLevelCounts(baseId, pageItems, itemCounts)
|
|||||||
return equivalentCounts
|
return equivalentCounts
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function getEquivalentBaseCounts(baseIds, itemCounts)
|
||||||
|
local equivalentCounts = {}
|
||||||
|
|
||||||
|
for i = 1, #baseIds do
|
||||||
|
local baseId = baseIds[i]
|
||||||
|
equivalentCounts[baseId] = getBaseEquivalentCount(baseId, itemCounts)
|
||||||
|
end
|
||||||
|
|
||||||
|
return equivalentCounts
|
||||||
|
end
|
||||||
|
|
||||||
local function createGlobalCountRefreshJob()
|
local function createGlobalCountRefreshJob()
|
||||||
ensureChainsLoaded()
|
ensureChainsLoaded()
|
||||||
|
|
||||||
@@ -1146,7 +1157,7 @@ drawOverview = function()
|
|||||||
local counts = getGlobalItemCounts()
|
local counts = getGlobalItemCounts()
|
||||||
|
|
||||||
if next(counts) ~= nil then
|
if next(counts) ~= nil then
|
||||||
overviewCachedCounts = counts
|
overviewCachedCounts = getEquivalentBaseCounts(items, counts)
|
||||||
end
|
end
|
||||||
|
|
||||||
return overviewCachedCounts
|
return overviewCachedCounts
|
||||||
@@ -1159,7 +1170,7 @@ drawOverview = function()
|
|||||||
overviewScrollTargetRow = targetRow
|
overviewScrollTargetRow = targetRow
|
||||||
end,
|
end,
|
||||||
getEntriesAndCountsFromCache = function()
|
getEntriesAndCountsFromCache = function()
|
||||||
overviewCachedCounts = getGlobalItemCounts()
|
overviewCachedCounts = getEquivalentBaseCounts(items, getGlobalItemCounts())
|
||||||
overviewCachedSortedItemIds = sortOverviewItems(overviewCachedCounts)
|
overviewCachedSortedItemIds = sortOverviewItems(overviewCachedCounts)
|
||||||
return overviewCachedSortedItemIds, overviewCachedCounts
|
return overviewCachedSortedItemIds, overviewCachedCounts
|
||||||
end,
|
end,
|
||||||
|
|||||||
Reference in New Issue
Block a user