File tree 1 file changed +0
-10
lines changed
packages/react-native-web/src/modules/ImageLoader
1 file changed +0
-10
lines changed Original file line number Diff line number Diff line change @@ -88,31 +88,21 @@ const ImageLoader = {
88
88
success : ( width : number , height : number ) => void ,
89
89
failure : ( ) => void
90
90
) {
91
- let complete = false ;
92
- const interval = setInterval ( callback , 16 ) ;
93
91
const requestId = ImageLoader . load ( uri , callback , errorCallback ) ;
94
-
95
92
function callback ( ) {
96
93
const image = requests [ `${ requestId } ` ] ;
97
94
if ( image ) {
98
95
const { naturalHeight, naturalWidth } = image ;
99
96
if ( naturalHeight && naturalWidth ) {
100
97
success ( naturalWidth , naturalHeight ) ;
101
- complete = true ;
102
98
}
103
99
}
104
- if ( complete ) {
105
- ImageLoader . abort ( requestId ) ;
106
- clearInterval ( interval ) ;
107
- }
108
100
}
109
-
110
101
function errorCallback ( ) {
111
102
if ( typeof failure === 'function' ) {
112
103
failure ( ) ;
113
104
}
114
105
ImageLoader . abort ( requestId ) ;
115
- clearInterval ( interval ) ;
116
106
}
117
107
} ,
118
108
has ( uri : string ) : boolean {
You can’t perform that action at this time.
0 commit comments