fix: move item to empty category

This commit is contained in:
Vati
2026-04-16 02:05:51 +04:00
parent 150c9d3574
commit 1af002fa08
4 changed files with 331 additions and 56 deletions
+22 -2
View File
@@ -97,6 +97,7 @@ local FRAME_BUDGET_SECONDS = 0.1 -- 100ms budget per frame (same as Baganator)
local lastEntryTime = 0
local workQueue = {}
local workQueueFrame = nil
local workQueuePaused = false -- When true, new QueueWork calls enqueue but don't resume processing
-- Report that we're starting work (call at the beginning of expensive operations)
-- This resets the frame budget timer
@@ -159,8 +160,11 @@ function Utils:QueueWork(callback, context)
end)
end
-- Show the frame to start processing
workQueueFrame:Show()
-- Show the frame to start processing (unless we're paused — new items
-- stay in the queue and are drained when ResumeWorkQueue is called).
if not workQueuePaused then
workQueueFrame:Show()
end
end
-- Clear all queued work (useful when frame is hidden)
@@ -171,6 +175,22 @@ function Utils:ClearWorkQueue()
end
end
-- Pause work queue processing (e.g. during a frame drag). Work stays queued
-- (including items QueueWork'd while paused); call ResumeWorkQueue to drain.
function Utils:PauseWorkQueue()
workQueuePaused = true
if workQueueFrame then
workQueueFrame:Hide()
end
end
function Utils:ResumeWorkQueue()
workQueuePaused = false
if workQueueFrame and table.getn(workQueue) > 0 then
workQueueFrame:Show()
end
end
-- Get the number of items in the work queue (for debugging)
function Utils:GetWorkQueueSize()
return table.getn(workQueue)