touchmenu: no empty menus (#14040)
Some checks failed
macos / macOS 13 x86-64 🔨15.2 🎯10.15 (push) Has been cancelled
macos / macOS 14 ARM64 🔨15.4 🎯11.0 (push) Has been cancelled

This commit is contained in:
hius07
2025-07-09 13:46:48 +03:00
committed by GitHub
parent 6a567406e2
commit e0c8530651

View File

@@ -652,6 +652,7 @@ function TouchMenu:init()
end
function TouchMenu:updateItems(target_page, target_item_id)
if #self.item_table == 0 then return end
self.perpage = math.min(self.max_per_page, self.item_table.max_per_page or self.max_per_page_default)
self.page_num = math.ceil(#self.item_table / self.perpage)
if target_item_id ~= nil then -- show menu page with target item