AdiBags - ItemRackSets

AdiBags - ItemRackSets

63k Downloads

ItemRack update requires waiting for ItemRack to load before registering ItemRack External Events

EnvoyMajeh opened this issue ยท 0 comments

commented

Stopped working when ItemRack released an update earlier today. Seems that ItemRack:RegisterExternalEventListener gets loaded later so ItemRack needs to finish loading before it can be used.
Not sure if this is the ideal fix, but I was able to get mine working again by changing a little bit in the Adibags-ItemRackSets.lua file -
On line 35/36 I changed:

ItemRack:RegisterExternalEventListener("ITEMRACK_SET_SAVED", itemRackUpdated)
ItemRack:RegisterExternalEventListener("ITEMRACK_SET_DELETED", itemRackUpdated)

to this:

local IREvents = CreateFrame("Frame", nil)
IREvents:RegisterEvent("ADDON_LOADED")
IREvents:SetScript("OnEvent", function(self, event, addon)
    if (addon == "ItemRack") then
        ItemRack:RegisterExternalEventListener("ITEMRACK_SET_SAVED", itemRackUpdated)
        ItemRack:RegisterExternalEventListener("ITEMRACK_SET_DELETED", itemRackUpdated)
    end
end)