Skip to content

Commit

Permalink
Select first session found by default (#141).
Browse files Browse the repository at this point in the history
  • Loading branch information
apognu committed May 17, 2024
1 parent 4ac1226 commit f6f9079
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/greeter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,17 @@ impl Greeter {

greeter.parse_options().await;

let sessions = get_sessions(&greeter).unwrap_or_default();

if let SessionSource::None = greeter.session_source {
if !sessions.is_empty() {
greeter.session_source = SessionSource::Session(0);
}
}

greeter.sessions = Menu {
title: fl!("title_session"),
options: get_sessions(&greeter).unwrap_or_default(),
options: sessions,
selected: 0,
};

Expand Down

0 comments on commit f6f9079

Please sign in to comment.