diff --git a/compcount.lua b/compcount.lua index d107a3d..2944a9c 100644 --- a/compcount.lua +++ b/compcount.lua @@ -757,7 +757,11 @@ local function runScrollableGrid(options) end renderGrid() - startRefreshJob() + + if options.shouldStartRefreshImmediately == nil or options.shouldStartRefreshImmediately(entries, counts) then + startRefreshJob() + end + refreshTimer = os.startTimer(options.refreshSeconds or 30) while true do @@ -874,6 +878,7 @@ local function drawPage(base_id) runScrollableGrid({ refreshSeconds = 5, + refreshStepSeconds = 0.02, getInitialEntries = function() return pageItems end, @@ -881,7 +886,7 @@ local function drawPage(base_id) return makeZeroCounts(pageItemIds) end, createRefreshJob = function(currentEntries) - local job = createAsyncMeItemCountsJob(pageItemIds, 3) + local job = createAsyncMeItemCountsJob(pageItemIds, 1) return { step = function() @@ -945,6 +950,7 @@ drawOverview = function() runScrollableGrid({ refreshSeconds = 30, + refreshStepSeconds = 0.02, getInitialEntries = function() if overviewCachedSortedItemIds and #overviewCachedSortedItemIds > 0 then return overviewCachedSortedItemIds @@ -963,7 +969,7 @@ drawOverview = function() overviewScrollTargetRow = targetRow end, createRefreshJob = function() - local job = createAsyncMeItemCountsJob(items, 6) + local job = createAsyncMeItemCountsJob(items, 1) return { step = function()