mirror of
https://github.com/aditya-K2/gspt.git
synced 2026-01-09 22:08:04 -05:00
Fix panic in liked songs view
This commit is contained in:
@@ -33,12 +33,14 @@ func (p *LikedSongsView) Content() func() [][]Content {
|
|||||||
msg <- "Liked Songs Loaded Succesfully!"
|
msg <- "Liked Songs Loaded Succesfully!"
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
for _, v := range *p.likedSongs {
|
if p.likedSongs != nil {
|
||||||
c = append(c, []Content{
|
for _, v := range *p.likedSongs {
|
||||||
{Content: v.Name, Style: TrackStyle},
|
c = append(c, []Content{
|
||||||
{Content: v.Artists[0].Name, Style: ArtistStyle},
|
{Content: v.Name, Style: TrackStyle},
|
||||||
{Content: v.Album.Name, Style: AlbumStyle},
|
{Content: v.Artists[0].Name, Style: ArtistStyle},
|
||||||
})
|
{Content: v.Album.Name, Style: AlbumStyle},
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return c
|
return c
|
||||||
}
|
}
|
||||||
@@ -81,6 +83,7 @@ func (l *LikedSongsView) Name() string { return "LikedSongsView" }
|
|||||||
|
|
||||||
func (p *LikedSongsView) refreshState(errHandler func(error)) {
|
func (p *LikedSongsView) refreshState(errHandler func(error)) {
|
||||||
cl, ch := spt.CurrentUserSavedTracks()
|
cl, ch := spt.CurrentUserSavedTracks()
|
||||||
|
p.likedSongs = cl
|
||||||
go func() {
|
go func() {
|
||||||
err := <-ch
|
err := <-ch
|
||||||
errHandler(err)
|
errHandler(err)
|
||||||
|
|||||||
Reference in New Issue
Block a user