Dispatcher: fix remove actions (#13227)
Some checks failed
macos / macOS ${{ matrix.image }} ${{ matrix.platform }} 🔨${{ matrix.xcode_version }} 🎯${{ matrix.deployment_target }} (10.15, 13, x86-64, 15.2) (push) Has been cancelled
macos / macOS ${{ matrix.image }} ${{ matrix.platform }} 🔨${{ matrix.xcode_version }} 🎯${{ matrix.deployment_target }} (11.0, 14, ARM64, 15.4) (push) Has been cancelled

Closes #13226.
This commit is contained in:
hius07
2025-02-09 12:41:23 +02:00
committed by GitHub
parent aa1e96f7d7
commit 2d4ffa9e3e

View File

@@ -942,17 +942,15 @@ function Dispatcher:_addItem(caller, menu, location, settings, section)
end
function Dispatcher.removeActions(actions, do_remove)
if actions then
local count = Dispatcher:_itemsCount(actions)
if count == 1 then
do_remove()
elseif count > 1 then
local ConfirmBox = require("ui/widget/confirmbox")
UIManager:show(ConfirmBox:new{
text = T(NC_("Dispatcher", "1 action will be removed.", "%1 actions will be removed.", count), count),
ok_callback = do_remove,
})
end
local count = actions and Dispatcher:_itemsCount(actions) or 0
if count > 1 then
local ConfirmBox = require("ui/widget/confirmbox")
UIManager:show(ConfirmBox:new{
text = T(NC_("Dispatcher", "1 action will be removed.", "%1 actions will be removed.", count), count),
ok_callback = do_remove,
})
else
do_remove()
end
end