[fix] title and author not changing when switching songs
Some checks failed
/ clippy (push) Failing after 8m31s
/ test (push) Failing after 6m31s

This commit is contained in:
Chris Cochrun 2026-05-18 11:40:37 -05:00
parent 1617dbe694
commit 780662b712

View file

@ -1152,13 +1152,19 @@ impl SongEditor {
..
} = theme::spacing();
let title_input = text_input("song", &self.title)
.on_input(Message::ChangeTitle)
.label("Song Title");
let title_input =
text_input("song", self.song.as_ref().map_or("", |song| &song.title))
.on_input(Message::ChangeTitle)
.label("Song Title");
let author_input = text_input("author", &self.author)
.on_input(Message::ChangeAuthor)
.label("Song Author");
let author_input = text_input(
"author",
self.song
.as_ref()
.map_or("", |song| song.author.as_ref().map_or("", |v| v)),
)
.on_input(Message::ChangeAuthor)
.label("Song Author");
let top_input_row = row![title_input, author_input].spacing(space_m);