a few more goroutines

This commit is contained in:
Drew Weymouth
2025-02-08 08:35:34 -03:00
parent ff78a79906
commit c7adeb5e32
6 changed files with 28 additions and 41 deletions
+15 -13
View File
@@ -64,20 +64,22 @@ func (a *GenresPage) load(searchOnLoad bool, scrollPos float32) {
if err != nil {
log.Printf("error loading genres: %v", err.Error())
}
a.genres = genres
if searchOnLoad {
a.onSearched(a.searcher.Entry.Text)
if scrollPos != 0 {
a.list.list.ScrollToOffset(scrollPos)
fyne.Do(func() {
a.genres = genres
if searchOnLoad {
a.onSearched(a.searcher.Entry.Text)
if scrollPos != 0 {
a.list.list.ScrollToOffset(scrollPos)
}
} else {
a.list.SetGenres(a.genres)
if scrollPos != 0 {
a.list.list.ScrollToOffset(scrollPos)
return
}
a.list.Refresh()
}
} else {
a.list.SetGenres(a.genres)
if scrollPos != 0 {
a.list.list.ScrollToOffset(scrollPos)
return
}
a.list.Refresh()
}
})
}
func (a *GenresPage) onSearched(query string) {