Skip to content

Commit

Permalink
fix a couple bugs
Browse files Browse the repository at this point in the history
Signed-off-by: Allen Faure <afaure6@gmail.com>
  • Loading branch information
emptyrivers committed Mar 23, 2024
1 parent e8ea8e3 commit 5785256
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions WeakAuras/TimeMachine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ function TimeMachine:Append(record)
table.insert(self.next.forward, record)
table.insert(self.next.backward, inverseRecord)
if not self.transaction then
self:Commit()
self:Commit(true)
end
end

Expand All @@ -193,10 +193,12 @@ function TimeMachine:Reject()
forward = {},
backward = {}
}
self.transaction = false
end

function TimeMachine:Commit()
if not self.transaction then return end
---@param instant? boolean
function TimeMachine:Commit(instant)
if not self.transaction and not instant then return end
while self.index < #self.changes do
table.remove(self.changes)
end
Expand Down

0 comments on commit 5785256

Please sign in to comment.