From 0cce9558169d20daaee6894ee9ff90932314d777 Mon Sep 17 00:00:00 2001 From: Lite Ye Date: Mon, 9 Jun 2025 02:03:46 -0400 Subject: [PATCH] fix: set confirm_popup to nil as soon as the callback is called (#2191) --- lua/avante/llm_tools/helpers.lua | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lua/avante/llm_tools/helpers.lua b/lua/avante/llm_tools/helpers.lua index 42632f1..6d35454 100644 --- a/lua/avante/llm_tools/helpers.lua +++ b/lua/avante/llm_tools/helpers.lua @@ -57,17 +57,13 @@ function M.confirm(message, callback, confirm_opts, session_ctx, tool_name) M.confirm_popup = Confirm:new(message, function(type, reason) if type == "yes" then callback(true) - return - end - if type == "all" then + elseif type == "all" then if session_ctx then session_ctx.always_yes = true end callback(true) - return - end - if type == "no" then + elseif type == "no" then callback(false, reason) - return end + M.confirm_popup = nil end, confirm_opts) M.confirm_popup:open() return M.confirm_popup