Skip to content

Commit

Permalink
chore(settings): Handle callbacks when poping state
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Feb 3, 2024
1 parent 433d46f commit 2e28023
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions core/settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,16 @@ end

function settings:popState ()
if not self then return deprecator() end
local previous = self.state
self.state = table.remove(self.stateQueue)
for parameter, oldvalue in pairs(previous) do
if self.hooks[parameter] then
local newvalue = self.state[parameter]
if oldvalue ~= newvalue then
self:runHooks(parameter, newvalue)
end
end
end
end

function settings:declare (spec)
Expand Down

0 comments on commit 2e28023

Please sign in to comment.