Skip to content

Commit

Permalink
added check for "SettingsRegistered" to prevent "possible" multiple t…
Browse files Browse the repository at this point in the history
…imes the Settings are Created... however ^^
  • Loading branch information
fuba82 committed Jul 31, 2024
1 parent 1cdd393 commit a50b2e5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion IPAConfig.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ eventFrame:RegisterEvent("PLAYER_ENTERING_WORLD")

IPASettings = IPASettings or {}

function IPA:CreateSettings()
local SettingsRegistered = false

function IPA:CreateSettings()
if SettingsRegistered then return end

local function OnSettingChanged(_, setting, value)
local variable = setting:GetVariable();
IPASettings["options"][variable] = value;
Expand Down Expand Up @@ -108,6 +111,8 @@ function IPA:CreateSettings()
SlashCmdList[addonName .. 'Options'] = function(msg)
Settings.OpenToCategory(categoryMain.ID)
end

SettingsRegistered = true
end

eventFrame:SetScript("OnEvent", function(self, event, ...)
Expand Down

0 comments on commit a50b2e5

Please sign in to comment.