Skip to content

Commit

Permalink
Set a default value for InputModal when renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoRiether committed Feb 15, 2024
1 parent 9bf7751 commit cde8548
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tori/src/update/browse_screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ fn browse_screen_command(
match &screen.focus {
Focus::Playlists | Focus::PlaylistsFilter(_) => {
state.modal = InputModal::new(" Rename playlist ")
.set_input(playlist.clone())
.style(Style::default().fg(Color::LightBlue))
.on_commit(move |new_name| Action::RenamePlaylist { playlist, new_name })
.some_box();
Expand All @@ -216,8 +217,10 @@ fn browse_screen_command(
}
Some(i) => i,
};
let old_name = screen.songs[index].title.clone();

state.modal = InputModal::new(" Rename song ")
.set_input(old_name)
.style(Style::default().fg(Color::LightBlue))
.on_commit(move |new_name| Action::RenameSong {
playlist: playlist.clone(),
Expand Down

0 comments on commit cde8548

Please sign in to comment.