Skip to content

Commit 2177f30

Browse files
EkdohibsZeno-
authored andcommittedApr 22, 2016
Fix mainmenu code downloading the public serverlist twice.
Also, fix a nil error that can happen sometimes in menu_handle_key_up_down
1 parent 7a6502a commit 2177f30

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed
 

‎builtin/mainmenu/common.lua

+9-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ end
178178

179179
--------------------------------------------------------------------------------
180180
function menu_handle_key_up_down(fields, textlist, settingname)
181-
local oldidx, newidx = core.get_textlist_index(textlist)
181+
local oldidx, newidx = core.get_textlist_index(textlist), 1
182182
if fields.key_up or fields.key_down then
183183
if fields.key_up and oldidx and oldidx > 1 then
184184
newidx = oldidx - 1
@@ -203,12 +203,20 @@ function asyncOnlineFavourites()
203203
end
204204
menudata.favorites = menudata.public_known
205205
menudata.favorites_is_public = true
206+
207+
if not menudata.public_downloading then
208+
menudata.public_downloading = true
209+
else
210+
return
211+
end
212+
206213
core.handle_async(
207214
function(param)
208215
return core.get_favorites("online")
209216
end,
210217
nil,
211218
function(result)
219+
menudata.public_downloading = nil
212220
local favs = order_favorite_list(result)
213221
if favs[1] then
214222
menudata.public_known = favs

0 commit comments

Comments
 (0)
Please sign in to comment.