From f1df9f6faef276bb20de0bb6a78873082194c0e2 Mon Sep 17 00:00:00 2001 From: Simon Garrelou Date: Mon, 12 Dec 2022 20:38:34 +0100 Subject: Do not allow to switch to other tabs if config isn't good --- src/app.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/app.go b/src/app.go index b998a50..173132c 100644 --- a/src/app.go +++ b/src/app.go @@ -126,6 +126,9 @@ func Run(cfg *Config) { func (a *app) switchToPage(name string) { switch name { case "artists": + if a.sub == nil { + return + } if !a.artistsLoaded { if err := a.refreshArtists(); err != nil { a.alert("Error: %v", err) @@ -137,11 +140,17 @@ func (a *app) switchToPage(name string) { a.tv.SetFocus(a.artistsTree) a.pages.SetBorder(false) case "playqueue": + if a.sub == nil { + return + } a.pages.SwitchToPage("playqueue") a.headerSections.Highlight("playqueue") a.tv.SetFocus(a.playQueueList) a.pages.SetBorder(true) case "playlists": + if a.sub == nil { + return + } if !a.playlistsLoaded { if err := a.refreshPlaylists(); err != nil { a.alert("Error: %v", err) -- cgit v1.2.3