@@ -12,6 +12,7 @@ import useNetwork from '@hooks/useNetwork';
12
12
import useStyleUtils from '@hooks/useStyleUtils' ;
13
13
import useThemeStyles from '@hooks/useThemeStyles' ;
14
14
import * as DeviceCapabilities from '@libs/DeviceCapabilities' ;
15
+ import * as FileUtils from '@libs/fileDownload/FileUtils' ;
15
16
import CONST from '@src/CONST' ;
16
17
import viewRef from '@src/types/utils/viewRef' ;
17
18
import type ImageViewProps from './types' ;
@@ -195,6 +196,8 @@ function ImageView({isAuthTokenRequired = false, url, fileName, onError}: ImageV
195
196
} ;
196
197
} , [ canUseTouchScreen , trackMovement , trackPointerPosition ] ) ;
197
198
199
+ const isLocalFile = FileUtils . isLocalFile ( url ) ;
200
+
198
201
if ( canUseTouchScreen ) {
199
202
return (
200
203
< View
@@ -213,8 +216,8 @@ function ImageView({isAuthTokenRequired = false, url, fileName, onError}: ImageV
213
216
onLoad = { imageLoad }
214
217
onError = { onError }
215
218
/>
216
- { ( ( isLoading && ! isOffline ) || ( ! isLoading && zoomScale === 0 ) ) && < FullscreenLoadingIndicator style = { [ styles . opacity1 , styles . bgTransparent ] } /> }
217
- { isLoading && < AttachmentOfflineIndicator /> }
219
+ { ( ( isLoading && ( ! isOffline || isLocalFile ) ) || ( ! isLoading && zoomScale === 0 ) ) && < FullscreenLoadingIndicator style = { [ styles . opacity1 , styles . bgTransparent ] } /> }
220
+ { isLoading && ! isLocalFile && < AttachmentOfflineIndicator /> }
218
221
</ View >
219
222
) ;
220
223
}
@@ -247,8 +250,8 @@ function ImageView({isAuthTokenRequired = false, url, fileName, onError}: ImageV
247
250
/>
248
251
</ PressableWithoutFeedback >
249
252
250
- { isLoading && ! isOffline && < FullscreenLoadingIndicator style = { [ styles . opacity1 , styles . bgTransparent ] } /> }
251
- { isLoading && < AttachmentOfflineIndicator /> }
253
+ { isLoading && ( ! isOffline || isLocalFile ) && < FullscreenLoadingIndicator style = { [ styles . opacity1 , styles . bgTransparent ] } /> }
254
+ { isLoading && ! isLocalFile && < AttachmentOfflineIndicator /> }
252
255
</ View >
253
256
) ;
254
257
}
0 commit comments