mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Added handling for connection errors that occur before client leaves login screen
This commit is contained in:
parent
cc98ccc371
commit
c8a1d821e7
@ -24,6 +24,7 @@ use crate::settings::Settings;
|
||||
use common::assets::{self, AssetExt};
|
||||
use rand::{seq::SliceRandom, thread_rng};
|
||||
use std::time::Duration;
|
||||
use tracing::warn;
|
||||
|
||||
// TODO: what is this? (showed up in rebase)
|
||||
//const COL1: Color = Color::Rgba(0.07, 0.1, 0.1, 0.9);
|
||||
@ -455,11 +456,15 @@ impl Controls {
|
||||
}
|
||||
|
||||
fn connection_error(&mut self, error: String) {
|
||||
if matches!(&self.screen, Screen::Connecting { .. }) {
|
||||
if matches!(&self.screen, Screen::Connecting { .. })
|
||||
|| matches!(&self.screen, Screen::Login { .. })
|
||||
{
|
||||
self.screen = Screen::Login {
|
||||
screen: Box::new(login::Screen::new()),
|
||||
error: Some(error),
|
||||
}
|
||||
} else {
|
||||
warn!("connection_error invoked on unhandled screen!");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user