Dispatcher: QuickMenu: Fix footgun

Fixes: #9594
reviewable/pr9598/r1
yparitcher 2 years ago
parent ad22942108
commit a916a5e8a2

@ -851,7 +851,8 @@ function Dispatcher:addSubMenu(caller, menu, location, settings)
and location[settings].settings.show_as_quickmenu and location[settings].settings.show_as_quickmenu
end, end,
callback = function() callback = function()
if location[settings] and location[settings].settings then if location[settings] then
if location[settings].settings then
if location[settings].settings.show_as_quickmenu then if location[settings].settings.show_as_quickmenu then
location[settings].settings.show_as_quickmenu = nil location[settings].settings.show_as_quickmenu = nil
if next(location[settings].settings) == nil then if next(location[settings].settings) == nil then
@ -864,6 +865,7 @@ function Dispatcher:addSubMenu(caller, menu, location, settings)
location[settings].settings = {["show_as_quickmenu"] = true} location[settings].settings = {["show_as_quickmenu"] = true}
end end
caller.updated = true caller.updated = true
end
end, end,
}) })
table.insert(menu, { table.insert(menu, {

Loading…
Cancel
Save