fix: set confirm_popup to nil as soon as the callback is called (#2191)
This commit is contained in:
@@ -57,17 +57,13 @@ function M.confirm(message, callback, confirm_opts, session_ctx, tool_name)
|
|||||||
M.confirm_popup = Confirm:new(message, function(type, reason)
|
M.confirm_popup = Confirm:new(message, function(type, reason)
|
||||||
if type == "yes" then
|
if type == "yes" then
|
||||||
callback(true)
|
callback(true)
|
||||||
return
|
elseif type == "all" then
|
||||||
end
|
|
||||||
if type == "all" then
|
|
||||||
if session_ctx then session_ctx.always_yes = true end
|
if session_ctx then session_ctx.always_yes = true end
|
||||||
callback(true)
|
callback(true)
|
||||||
return
|
elseif type == "no" then
|
||||||
end
|
|
||||||
if type == "no" then
|
|
||||||
callback(false, reason)
|
callback(false, reason)
|
||||||
return
|
|
||||||
end
|
end
|
||||||
|
M.confirm_popup = nil
|
||||||
end, confirm_opts)
|
end, confirm_opts)
|
||||||
M.confirm_popup:open()
|
M.confirm_popup:open()
|
||||||
return M.confirm_popup
|
return M.confirm_popup
|
||||||
|
|||||||
Reference in New Issue
Block a user