Although the equipType would be the same since both items go in the same equip slot the itemStyles might not be the same, so that really needs to be updated also. You could just nil out the cache & set cached = false, like I did in my example above, but if you want to fix the cache instead of nilling it out the itemStyle needs to be updated as well:
Lua Code:
local function OnSlotUpdated(bagId, slotIndex, slotData)
if slotData and slotData.searchData and slotData.searchData.cached and slotData.searchData.cache then
local name = GetItemName(bagId, slotIndex)
name = name:lower()
if name ~= slotData.searchData.cache[1] then
local _, _, _, _, _, equipType, itemStyle = GetItemInfo(bagId, slotIndex)
slotData.searchData.cache = {name, equipType, itemStyle}
end
end
end
SHARED_INVENTORY:RegisterCallback("SlotUpdated", OnSlotUpdated)
Nilling it out would probably be the best solution though. Whenever a search is started it checks to see if data is cached and if its not it grabs that data on its own. That way it would only have to mess with those calls to update the cache if a search is being run instead of every time they don't match in the OnSlotUpdate.