more fyne.Dos

This commit is contained in:
Drew Weymouth
2025-02-08 08:35:34 -03:00
parent 61bfbeb349
commit e72e56db1c
3 changed files with 50 additions and 51 deletions
+10 -6
View File
@@ -108,17 +108,21 @@ func (p *PlaylistsPage) Scroll(scrollAmt float32) {
}
}
// should be called asynchronously
func (a *PlaylistsPage) load(searchOnLoad bool) {
playlists, err := a.mp.GetPlaylists()
if err != nil {
log.Printf("error loading playlists: %v", err.Error())
}
a.playlists = playlists
if searchOnLoad {
a.onSearched(a.searcher.Entry.Text)
} else {
a.refreshView(playlists)
}
fyne.Do(func() {
a.playlists = playlists
if searchOnLoad {
a.onSearched(a.searcher.Entry.Text)
} else {
a.refreshView(playlists)
}
})
}
func (a *PlaylistsPage) createListView() {