Skip to content
Permalink
Browse files

More reliable serverlist behaviour

-> remember the previously loaded serverlist, and use if new one failed
-> show a "loading" serverlist
  • Loading branch information
HybridDog authored and est31 committed Jun 9, 2015
1 parent e481745 commit 05f4e9ee08f93b17c3dbaf2b6a1022cc28a226ce
Showing with 13 additions and 3 deletions.
  1. +13 −3 builtin/mainmenu/common.lua
@@ -234,19 +234,29 @@ end
--------------------------------------------------------------------------------
function asyncOnlineFavourites()

menudata.favorites = {}
if not menudata.public_known then
menudata.public_known = {{
name = fgettext("Loading..."),
description = fgettext("Try reenabling public serverlist and check your internet connection.")
}}
end
menudata.favorites = menudata.public_known
core.handle_async(
function(param)
return core.get_favorites("online")
end,
nil,
function(result)
if core.setting_getbool("public_serverlist") then
menudata.favorites = order_favorite_list(result)
local favs = order_favorite_list(result)
if favs[1] then
menudata.public_known = favs
menudata.favorites = menudata.public_known
end
core.event_handler("Refresh")
end
end
)
)
end

--------------------------------------------------------------------------------

0 comments on commit 05f4e9e

Please sign in to comment.
You can’t perform that action at this time.