diff --git a/src/handlers/basic_view.rs b/src/handlers/basic_view.rs index d9480082..a2f10d1e 100644 --- a/src/handlers/basic_view.rs +++ b/src/handlers/basic_view.rs @@ -1,3 +1,13 @@ -use crate::{app::App, event::Key}; +use crate::{app::App, event::Key, network::IoEvent}; -pub fn handler(_key: Key, _app: &mut App) {} +pub fn handler(key: Key, app: &mut App) { + if let Key::Char('s') = key { + if let Some(playing_context) = &app.current_playback_context { + if let Some(track) = &playing_context.clone().item { + if let Some(id) = &track.id { + app.dispatch(IoEvent::ToggleSaveTrack(id.to_string())); + } + } + } + } +}