@@ -215,16 +215,22 @@ end
215
215
Updates the cooldown representations of all items in the trinketMenu
216
216
]] --
217
217
function me .UpdateTrinketMenuSlotCooldowns ()
218
- for _ , trinketMenuSlot in pairs (trinketMenuSlots ) do
219
- if trinketMenuSlot .itemId ~= nil then
220
- if mod .configuration .IsShowCooldownsEnabled () then
221
- local startTime , duration = C_Container .GetItemCooldown (trinketMenuSlot .itemId )
222
- CooldownFrame_Set (trinketMenuSlot .cooldownOverlay , startTime , duration , true )
218
+ local showCooldowns = mod .configuration .IsShowCooldownsEnabled ()
219
+
220
+ for _ , slot in pairs (trinketMenuSlots ) do
221
+ local itemId = slot .itemId
222
+ local cooldownOverlay = slot .cooldownOverlay
223
+
224
+ if itemId and showCooldowns then
225
+ local startTime , duration = C_Container .GetItemCooldown (itemId )
226
+ -- If GetItemCooldown returns 0, 0 (meaning no cooldown), we clear it out
227
+ if startTime and duration and (startTime ~= 0 or duration ~= 0 ) then
228
+ CooldownFrame_Set (cooldownOverlay , startTime , duration , true )
223
229
else
224
- CooldownFrame_Clear (trinketMenuSlot . cooldownOverlay )
230
+ CooldownFrame_Clear (cooldownOverlay )
225
231
end
226
232
else
227
- CooldownFrame_Clear (trinketMenuSlot . cooldownOverlay )
233
+ CooldownFrame_Clear (cooldownOverlay )
228
234
end
229
235
end
230
236
end
0 commit comments