From 2d4ffa9e3e9b105cde567b867543b53e467b5dc2 Mon Sep 17 00:00:00 2001 From: hius07 <62179190+hius07@users.noreply.github.com> Date: Sun, 9 Feb 2025 12:41:23 +0200 Subject: [PATCH] Dispatcher: fix remove actions (#13227) Closes #13226. --- frontend/dispatcher.lua | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/frontend/dispatcher.lua b/frontend/dispatcher.lua index 8f99ae584..0de38a23a 100644 --- a/frontend/dispatcher.lua +++ b/frontend/dispatcher.lua @@ -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