fix: refresh slots on container swap

This commit is contained in:
Vati
2026-04-03 02:03:54 +04:00
parent 463f263d53
commit d456900707
+17 -7
View File
@@ -3070,16 +3070,26 @@ Guda_TryEquipBagOnSlot = function(bagID, invSlot, button)
if hasItems and addon.Modules.BagReplacer then
addon.Modules.BagReplacer:Execute(bagID, invSlot)
else
if EquipCursorItem then
EquipCursorItem(invSlot)
elseif PutItemInBag then
PutItemInBag(invSlot)
end
return -- BagReplacer handles its own UI updates
end
-- Empty bag or no bag — standard equip, then delayed refresh
if EquipCursorItem then
EquipCursorItem(invSlot)
elseif PutItemInBag then
PutItemInBag(invSlot)
end
if button then Guda_BagSlot_Update(button, bagID) end
if BagFrame and BagFrame.Update then BagFrame:Update() end
-- Delay the UI refresh so the server has time to process the bag equip
-- (GetContainerNumSlots won't reflect the new bag size immediately)
Guda_ScheduleTimer(0.3, function()
if addon.Modules.BagScanner and addon.Modules.BagScanner.InvalidateCache then
addon.Modules.BagScanner:InvalidateCache()
end
if BagFrame and BagFrame.Update then BagFrame:Update() end
end)
end
-- OnLoad handler for bag slot buttons