Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error when enabling texture packs in the "Content" tab #13829

Merged
merged 1 commit into from
Sep 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 11 additions & 5 deletions builtin/mainmenu/tab_content.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@

local packages_raw, packages

local function on_change(type)
if type ~= "ENTER" then
return
end

local function update_packages()
if not pkgmgr.global_mods then
pkgmgr.refresh_globals()
end
Expand All @@ -48,7 +44,17 @@ local function on_change(type)
is_equal, nil, {})
end

local function on_change(type)
if type == "ENTER" then
update_packages()
end
end

local function get_formspec(tabview, name, tabdata)
if not packages then
update_packages()
end

if not tabdata.selected_pkg then
tabdata.selected_pkg = 1
end
Expand Down