Fix disconnected-from-server multiplayer exit sequence being blocked by confirmation dialog

This commit is contained in:
Dean Herbert 2021-07-13 17:12:35 +09:00
parent e70744ee37
commit 60e17fc2b7
1 changed files with 3 additions and 1 deletions

View File

@ -310,7 +310,9 @@ public override bool OnBackButton()
public override bool OnExiting(IScreen next)
{
if (client.Room == null)
// the room may not be left immediately after a disconnection due to async flow,
// so checking the IsConnected status is also required.
if (client.Room == null || !client.IsConnected.Value)
{
// room has not been created yet; exit immediately.
return base.OnExiting(next);