Add: [Network] Keep the refresh button in lowered state while refreshing (#9600)
This gives user visual feedback that the refresh is still pending, and prevents people from clicking again and again thinking nothing is happening. This is especially true for connections that fall back to TURN, as that takes a few seconds to kick in. Additionally, prevent clicking on the button again while a refresh is pending. This is only delaying a successful result.
This commit is contained in:
@@ -635,6 +635,7 @@ public:
|
||||
{
|
||||
NetworkGameList *item = NetworkGameListAddItem(connection_string);
|
||||
item->status = NGLS_OFFLINE;
|
||||
item->refreshing = false;
|
||||
|
||||
UpdateNetworkGameWindow();
|
||||
}
|
||||
@@ -653,6 +654,10 @@ void NetworkQueryServer(const std::string &connection_string)
|
||||
{
|
||||
if (!_network_available) return;
|
||||
|
||||
/* Mark the entry as refreshing, so the GUI can show the refresh is pending. */
|
||||
NetworkGameList *item = NetworkGameListAddItem(connection_string);
|
||||
item->refreshing = true;
|
||||
|
||||
new TCPQueryConnecter(connection_string);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user