From 54b34837f331a8f7e85b55e260e18d9df7482af3 Mon Sep 17 00:00:00 2001 From: Thang Pham Date: Tue, 17 Dec 2024 13:36:44 -0500 Subject: [PATCH] better UI for no playback on lyrics page --- spotify_player/src/ui/page.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/spotify_player/src/ui/page.rs b/spotify_player/src/ui/page.rs index b7bb75f2..fac21b80 100644 --- a/spotify_player/src/ui/page.rs +++ b/spotify_player/src/ui/page.rs @@ -552,10 +552,6 @@ pub fn render_lyrics_page( rect: Rect, ) { // 1. Get data - let Some(progress) = state.player.read().playback_progress() else { - frame.render_widget(Paragraph::new("Lyrics not found"), rect); - return; - }; let data = state.data.read(); // 2. Construct the page's layout @@ -563,6 +559,11 @@ pub fn render_lyrics_page( let chunks = Layout::vertical([Constraint::Length(2), Constraint::Fill(0)]).split(rect); // 3. Construct the page's widgets + let Some(progress) = state.player.read().playback_progress() else { + frame.render_widget(Paragraph::new("No playback available"), rect); + return; + }; + let PageState::Lyrics { track_uri, track,