Krolyxon
Commit 51fbf42

rmptui51fbf42

fix >/< keybinds

Author
krolxon
Date
2024-04-29 11:55 +0530
Parent
8b16d3e
Commit
51fbf426531fc9843afbbd7736eb5c3564f39658

+6 −2

1 file changed

  1. M src/handler.rs +6 −2
M src/handler.rs View
@@ -275,12 +275,16 @@ pub fn handle_key_events(key_event: KeyEvent, app: &mut App) -> AppResult<()> {
275275
276276 // Play next song
277277 KeyCode::Char('>') => {
278− app.conn.conn.next()?;
278+ if !app.queue_list.list.is_empty() {
279+ app.conn.conn.next()?;
280+ }
279281 }
280282
281283 // Play previous song
282284 KeyCode::Char('<') => {
283− app.conn.conn.prev()?;
285+ if !app.queue_list.list.is_empty() {
286+ app.conn.conn.prev()?;
287+ }
284288 }
285289
286290 // Volume controls