more fyne.Do updates

This commit is contained in:
Drew Weymouth
2025-02-08 08:35:33 -03:00
parent 89012a8fe8
commit ff78a79906
7 changed files with 34 additions and 76 deletions
+5 -2
View File
@@ -3,6 +3,7 @@ package widgets
import (
"sync/atomic"
"fyne.io/fyne/v2"
"github.com/dweymouth/supersonic/backend/mediaprovider"
)
@@ -69,8 +70,10 @@ func (t *TracklistLoader) loadMoreTracks(num int) {
if t.disposed.Load() {
return
}
t.tracklist.AppendTracks(t.trackBuffer)
t.len += len(t.trackBuffer)
fyne.Do(func() {
t.tracklist.AppendTracks(t.trackBuffer)
t.len += len(t.trackBuffer)
})
}
if t.done {
t.trackBuffer = nil