From e6a4cebe1a1e2ae4f859fcb0828ba78127780f77 Mon Sep 17 00:00:00 2001 From: Philip Kristoffersen Date: Sat, 7 Jan 2023 14:04:11 +0100 Subject: [PATCH] Simplify user selection (#318) --- src/steam/utils.rs | 4 ++++ src/ui/components/steam_user_select.rs | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/steam/utils.rs b/src/steam/utils.rs index c3cd876..1ab2a92 100644 --- a/src/steam/utils.rs +++ b/src/steam/utils.rs @@ -77,6 +77,10 @@ pub fn get_shortcuts_paths(settings: &SteamSettings) -> eyre::Result meta.is_dir(), _ => false, }) + .filter(|folder| { + let user_id = folder.file_name().to_string_lossy().to_string(); + user_id != "0" + }) .map(|folder| { let user_id = folder.file_name().to_string_lossy().to_string(); let folder_path = folder.path(); diff --git a/src/ui/components/steam_user_select.rs b/src/ui/components/steam_user_select.rs index adafc81..0be174c 100644 --- a/src/ui/components/steam_user_select.rs +++ b/src/ui/components/steam_user_select.rs @@ -7,6 +7,9 @@ pub fn render_user_select<'a>( ) -> Option<&'a SteamUsersInfo> { if let Some(mut selected_user) = steam_user { let id_before = selected_user.user_id.clone(); + if steam_users.len() <= 1{ + return None; + } if !steam_users.is_empty() { let combo_box = egui::ComboBox::new("ImageUserSelect", "") .selected_text(format!("Steam user id: {}", &selected_user.user_id));