mirror of
https://github.com/apognu/tuigreet.git
synced 2024-09-11 07:25:29 +03:00
Select first session found by default (#141).
This commit is contained in:
parent
1f7dfc994c
commit
613c7e26ec
@ -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,
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user