From ac897da69a88acb36fd342858d2c18cc54350913 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Moreno?= Date: Wed, 13 Sep 2017 14:19:51 +0200 Subject: [PATCH] If not default room, don't enter in the first one --- src/app.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/app.rs b/src/app.rs index c5a92289..6e5ae005 100644 --- a/src/app.rs +++ b/src/app.rs @@ -346,13 +346,7 @@ impl AppOp { array.sort_by(|x, y| x.name.to_lowercase().cmp(&y.name.to_lowercase())); - let mut default: Option = def; - for v in array { - if default.is_none() { - default = Some(v.clone()); - } - let ns = match v.notifications { 0 => String::new(), i => format!("{}", i), @@ -361,8 +355,8 @@ impl AppOp { store.insert_with_values(None, None, &[0, 1, 2], &[&v.name, &v.id, &ns]); } - if let Some(def) = default { - self.set_active_room(def.id, def.name); + if let Some(d) = def { + self.set_active_room(d.id, d.name); } else { self.room_panel(RoomPanel::NoRoom); }