fix(ui): prevent confirm dialog from closing prematurely on rejection (#2218)
This commit is contained in:
@@ -151,18 +151,22 @@ function M:open()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function click_button()
|
local function click_button()
|
||||||
self:close()
|
|
||||||
if focus_index == 1 then
|
if focus_index == 1 then
|
||||||
|
self:close()
|
||||||
callback("yes")
|
callback("yes")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if focus_index == 2 then
|
if focus_index == 2 then
|
||||||
|
self:close()
|
||||||
Utils.notify("Accept all")
|
Utils.notify("Accept all")
|
||||||
callback("all")
|
callback("all")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local prompt_input = PromptInput:new({
|
local prompt_input = PromptInput:new({
|
||||||
submit_callback = function(input) callback("no", input ~= "" and input or nil) end,
|
submit_callback = function(input)
|
||||||
|
self:close()
|
||||||
|
callback("no", input ~= "" and input or nil)
|
||||||
|
end,
|
||||||
close_on_submit = true,
|
close_on_submit = true,
|
||||||
win_opts = {
|
win_opts = {
|
||||||
relative = "win",
|
relative = "win",
|
||||||
|
|||||||
Reference in New Issue
Block a user