fix race condition with async image fetches

This commit is contained in:
Drew Weymouth
2022-12-17 18:12:37 -08:00
parent a85d377a82
commit 78050f8b43
3 changed files with 35 additions and 9 deletions
+8 -1
View File
@@ -1,6 +1,7 @@
package ui
import (
"context"
"image"
"log"
@@ -39,9 +40,15 @@ type AlbumCard struct {
albumID string
title *widget.Label
artist *widget.Label
Cover *TappableImage
container *fyne.Container
// updated by AlbumGrid
Cover *TappableImage
// these fields are used by AlbumGrid to track async update tasks
PrevAlbumID string
ImgLoadCancel context.CancelFunc
OnTapped func()
}