fix: effectScope should set scope

This commit is contained in:
littensy 2025-05-03 21:16:53 -07:00
parent e34b0c9aca
commit a0fc88ede1
2 changed files with 5 additions and 5 deletions

View file

@ -324,9 +324,9 @@ local function effectScope(fn: () -> ...() -> ()?): () -> ()
if activeScope then
link(e, activeScope)
end
local prev = setCurrentSub(e)
local prev = setCurrentScope(e)
local success, result = pcall(fn)
setCurrentSub(prev)
setCurrentScope(prev)
if not success then
error(result)
end