Skip to content

Commit

Permalink
power: Store and forward the used minimum value correctly (#695)
Browse files Browse the repository at this point in the history
  • Loading branch information
p3lim authored Nov 30, 2024
1 parent 663f68d commit ad3375c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion elements/power.lua
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ local function Update(self, event, unit)
end

local cur, max = UnitPower(unit, displayType), UnitPowerMax(unit, displayType)
element:SetMinMaxValues(min or 0, max)
min = min or 0 -- ensure we always have a minimum value to avoid errors
element:SetMinMaxValues(min, max)

if(UnitIsConnected(unit)) then
element:SetValue(cur)
Expand Down

0 comments on commit ad3375c

Please sign in to comment.