mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Add a check so setting src on async image multiple times wont mismatch imageSource
This commit is contained in:
@@ -97,6 +97,9 @@ export class Image extends view.View implements definition.Image {
|
||||
|
||||
var source = new imageSource.ImageSource();
|
||||
var imageLoaded = () => {
|
||||
if (value !== this.src) {
|
||||
return;
|
||||
}
|
||||
this.imageSource = source;
|
||||
this._setValue(Image.isLoadingProperty, false);
|
||||
}
|
||||
@@ -143,9 +146,11 @@ export class Image extends view.View implements definition.Image {
|
||||
else if (value instanceof imageSource.ImageSource) {
|
||||
// Support binding the imageSource trough the src property
|
||||
this.imageSource = value;
|
||||
this._setValue(Image.isLoadingProperty, false);
|
||||
}
|
||||
else {
|
||||
this.imageSource = imageSource.fromNativeSource(value);
|
||||
this._setValue(Image.isLoadingProperty, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user