Skip to content

Commit

Permalink
move key arg before newState arg
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbuds committed Jun 28, 2024
1 parent 87863e6 commit b249b70
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions WeakAuras/TSUHelpers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ local function recurseUpdate(t1, t2)
return changed
end

---@type fun(states: states, newState: state, key: key): boolean
local update = function(states, newState, key)
---@type fun(states: states, key: key, newState: state): boolean
local update = function(states, key, newState)
local changed = false
local state = states[key]
if state then
Expand All @@ -70,21 +70,21 @@ local update = function(states, newState, key)
return changed
end

---@type fun(states: states, newState: state, key: key): boolean
local create = function(states, newState, key)
---@type fun(states: states, key: key, newState: state): boolean
local create = function(states, key, newState)
states[key] = newState
states[key].changed = true
fixMissingFields(states[key])
return true
end

---@type fun(states: states, newState: state, key: key?): boolean
local createOrUpdate = function(states, newState, key)
---@type fun(states: states, key: key?, newState: state): boolean
local createOrUpdate = function(states, key, newState)
key = key or ""
if states[key] then
return update(states, newState, key)
return update(states, key, newState)
else
return create(states, newState, key)
return create(states, key, newState)
end
end

Expand Down
2 changes: 1 addition & 1 deletion WeakAurasOptions/OptionsFrames/TextEditor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ end]=]
name = "Trigger State Updater",
snippet = [=[
function(allstates, event, ...)
return allstates:Update({
return allstates:Update("", {
show = true,
changed = true,
progressType = "static"||"timed",
Expand Down

0 comments on commit b249b70

Please sign in to comment.