diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/app.go | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -126,6 +126,9 @@ func Run(cfg *Config) { | |||
126 | func (a *app) switchToPage(name string) { | 126 | func (a *app) switchToPage(name string) { |
127 | switch name { | 127 | switch name { |
128 | case "artists": | 128 | case "artists": |
129 | if a.sub == nil { | ||
130 | return | ||
131 | } | ||
129 | if !a.artistsLoaded { | 132 | if !a.artistsLoaded { |
130 | if err := a.refreshArtists(); err != nil { | 133 | if err := a.refreshArtists(); err != nil { |
131 | a.alert("Error: %v", err) | 134 | a.alert("Error: %v", err) |
@@ -137,11 +140,17 @@ func (a *app) switchToPage(name string) { | |||
137 | a.tv.SetFocus(a.artistsTree) | 140 | a.tv.SetFocus(a.artistsTree) |
138 | a.pages.SetBorder(false) | 141 | a.pages.SetBorder(false) |
139 | case "playqueue": | 142 | case "playqueue": |
143 | if a.sub == nil { | ||
144 | return | ||
145 | } | ||
140 | a.pages.SwitchToPage("playqueue") | 146 | a.pages.SwitchToPage("playqueue") |
141 | a.headerSections.Highlight("playqueue") | 147 | a.headerSections.Highlight("playqueue") |
142 | a.tv.SetFocus(a.playQueueList) | 148 | a.tv.SetFocus(a.playQueueList) |
143 | a.pages.SetBorder(true) | 149 | a.pages.SetBorder(true) |
144 | case "playlists": | 150 | case "playlists": |
151 | if a.sub == nil { | ||
152 | return | ||
153 | } | ||
145 | if !a.playlistsLoaded { | 154 | if !a.playlistsLoaded { |
146 | if err := a.refreshPlaylists(); err != nil { | 155 | if err := a.refreshPlaylists(); err != nil { |
147 | a.alert("Error: %v", err) | 156 | a.alert("Error: %v", err) |