Forráskód Böngészése

PhotosScreen cache fix

Viktoriia 1 hete
szülő
commit
70c29214ee

+ 5 - 5
src/screens/InAppScreens/TravelsScreen/Components/PhotoItem.tsx

@@ -40,7 +40,7 @@ export const PhotoItem = React.memo(
         return (
           <TouchableOpacity onPress={() => openImageViewer(0)}>
             <Image
-              source={{ uri: getImageUri(photos[0].url_small) }}
+              source={{ uri: getImageUri(photos[0].url_small), cache: 'reload' }}
               style={photoStyles.onePhoto}
             />
           </TouchableOpacity>
@@ -49,7 +49,7 @@ export const PhotoItem = React.memo(
         return photos.map((photo: PhotosData, index: number) => (
           <TouchableOpacity key={photo.id} onPress={() => openImageViewer(index)}>
             <Image
-              source={{ uri: getImageUri(photo.url_small) }}
+              source={{ uri: getImageUri(photo.url_small), cache: 'reload' }}
               style={[photoStyles.twoPhotos, index === 0 && { marginRight: 8 }]}
             />
           </TouchableOpacity>
@@ -59,7 +59,7 @@ export const PhotoItem = React.memo(
           <View style={{ flexDirection: 'row' }}>
             <TouchableOpacity onPress={() => openImageViewer(0)}>
               <Image
-                source={{ uri: getImageUri(photos[0].url_small) }}
+                source={{ uri: getImageUri(photos[0].url_small), cache: 'reload' }}
                 style={photoStyles.bigPhoto}
               />
             </TouchableOpacity>
@@ -67,13 +67,13 @@ export const PhotoItem = React.memo(
             <View style={styles.smallPhotoContainer}>
               <TouchableOpacity onPress={() => openImageViewer(1)}>
                 <Image
-                  source={{ uri: getImageUri(photos[1].url_small) }}
+                  source={{ uri: getImageUri(photos[1].url_small), cache: 'reload' }}
                   style={photoStyles.smallPhoto}
                 />
               </TouchableOpacity>
               <TouchableOpacity onPress={() => openImageViewer(2)}>
                 <Image
-                  source={{ uri: getImageUri(photos[2].url_small) }}
+                  source={{ uri: getImageUri(photos[2].url_small), cache: 'reload' }}
                   style={[photoStyles.smallPhoto, { position: 'relative' }]}
                 />
               </TouchableOpacity>

+ 1 - 1
src/screens/InAppScreens/TravelsScreen/MorePhotosScreen/index.tsx

@@ -169,7 +169,7 @@ const MorePhotosScreen = ({ route }: { route: any }) => {
         onPress={() => (selectionMode ? handleSelectPhoto(item.id) : openImageViewer(index))}
       >
         <Image
-          source={{ uri: API_HOST + item?.url_small }}
+          source={{ uri: API_HOST + item?.url_small, cache: 'reload' }}
           style={[styles.image, { width: itemWidth, height: itemWidth }]}
         />
         <TouchableOpacity