Skip to content

Commit

Permalink
Simplify user selection (#318)
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipK committed Jan 7, 2023
1 parent f6188b1 commit e6a4ceb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/steam/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ pub fn get_shortcuts_paths(settings: &SteamSettings) -> eyre::Result<Vec<SteamUs
Ok(meta) => 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();
Expand Down
3 changes: 3 additions & 0 deletions src/ui/components/steam_user_select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit e6a4ceb

Please sign in to comment.