Fix Locations

This commit is contained in:
John Gibbon 2021-01-15 21:34:58 +01:00
parent e6748dbc18
commit 935bcaeb85

View file

@ -51,17 +51,16 @@ MessageContentBase {
Connections {
target: tdLibWrapper
onFileUpdated: {
if(fileInformation["@extra"] !== imagePreviewItem.fileExtra) {
if(fileInformation["@extra"] !== imagePreviewItem.fileExtra && (!imagePreviewItem.pictureFileInformation || imagePreviewItem.pictureFileInformation.id !== fileInformation.id)) {
return;
}
if(!imagePreviewItem.pictureFileInformation) {
imagePreviewItem.pictureFileInformation = fileInformation;
tdLibWrapper.downloadFile(imagePreviewItem.pictureFileInformation.id);
} else if(imagePreviewItem.pictureFileInformation && fileInformation.id === imagePreviewItem.pictureFileInformation.id) {
imagePreviewItem.pictureFileInformation = fileInformation;
if(fileInformation.local.is_downloading_completed) {
singleImage.source = fileInformation.local.path;
} else if(fileInformation.local.can_be_downloaded && !fileInformation.local.is_downloading_active) {
tdLibWrapper.downloadFile(fileInformation.id);
}
imagePreviewItem.pictureFileInformation = fileInformation;
}
}