[ui] thumbnail request: stop timer after 1st trigger to avoid running endlessly in background

This commit is contained in:
Loïc Vital 2023-02-13 15:33:34 +01:00
parent 334bfc8b00
commit b4851d7a50

View file

@ -41,19 +41,15 @@ Item {
updateThumbnail();
}
// Send a new request every 5 seconds until thumbnail is loaded
// Send a new request after 5 seconds if thumbnail is not loaded
// This is meant to avoid deadlocks in case there is a synchronization problem
Timer {
interval: 5000
repeat: true
running: true
onTriggered: {
if (thumbnail.status == Image.Null) {
updateThumbnail();
}
else {
running = false;
}
}
}