mirror of
https://github.com/minetest-mods/craftguide.git
synced 2024-11-25 20:23:42 +01:00
Cache results only if searched 2 times (to avoid silly searches)
This commit is contained in:
parent
c630c90970
commit
d95cdee33d
9
init.lua
9
init.lua
@ -343,8 +343,13 @@ function craftguide:get_filter_items(data, player)
|
||||
if not data.items then
|
||||
data.init_filter_items = filtered_list
|
||||
end
|
||||
elseif filter ~= "" and not datas.searches[filter] then
|
||||
datas.searches[filter] = filtered_list
|
||||
elseif filter ~= "" then
|
||||
-- Cache the results only if searched 2 times
|
||||
if datas.searches[filter] == nil then
|
||||
datas.searches[filter] = false
|
||||
else
|
||||
datas.searches[filter] = filtered_list
|
||||
end
|
||||
end
|
||||
|
||||
data.items = filtered_list
|
||||
|
Loading…
Reference in New Issue
Block a user