One-shot event handlers: use EventUtil.RegisterOnceFrameEventAndCallback instead of self-unregistering frames

This commit is contained in:
Brues
2026-11-03 01:07:02 -06:00
parent d143e91f81
commit 70bfc1c443
7 changed files with 10 additions and 59 deletions
+1 -5
View File
@@ -801,11 +801,7 @@ pfUI:RegisterModule("thirdparty-vanilla", function()
HookAddon("SortBags", function()
if C.thirdparty.sortbags.enable == "0" then return end
local sort = CreateFrame("Frame", nil)
sort:RegisterEvent("PLAYER_ENTERING_WORLD")
sort:SetScript("OnEvent", function()
this:UnregisterAllEvents()
EventUtil.RegisterOnceFrameEventAndCallback("PLAYER_ENTERING_WORLD", function()
pfUI.thirdparty.RegisterBagSort("SortBags",
function()
SortBags()