Copertine: validazione contenuto prima del caching (niente più HTML in cache), id fisso per il dettaglio, handler con sintassi moderna
This commit is contained in:
@@ -172,13 +172,14 @@ Page {
|
||||
|
||||
Component.onCompleted: {
|
||||
if (bookData.coverUrl && bookData.coverUrl.length > 0)
|
||||
apiClient.fetchImage(bookData.coverUrl, "detail:" + bookData.id)
|
||||
apiClient.fetchImage(bookData.coverUrl, "detailcover")
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: apiClient
|
||||
onImageReady: {
|
||||
if (id === "detail:" + bookData.id)
|
||||
// nota: parametro rinominato (imageId) — "id" è parola chiave QML e rompe il confronto
|
||||
onImageReady: function(imageId, localPath) {
|
||||
if (imageId === "detailcover")
|
||||
page.coverSource = localPath
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user