Bluesky app fork with some witchin' additions 💫

Fix render loop on Android (#6213)

authored by danabra.mov and committed by

GitHub b4412f33 89c93313

+23 -11
+8 -4
src/view/com/lightbox/ImageViewing/components/ImageItem/ImageItem.android.tsx
··· 396 396 placeholderContentFit="cover" 397 397 placeholder={{uri: imageSrc.thumbUri}} 398 398 accessibilityLabel={imageSrc.alt} 399 - onLoad={e => { 400 - setHasLoaded(true) 401 - onLoad({width: e.source.width, height: e.source.height}) 402 - }} 399 + onLoad={ 400 + hasLoaded 401 + ? undefined 402 + : e => { 403 + setHasLoaded(true) 404 + onLoad({width: e.source.width, height: e.source.height}) 405 + } 406 + } 403 407 style={{flex: 1, borderRadius}} 404 408 accessibilityHint="" 405 409 accessibilityIgnoresInvertColors
+8 -4
src/view/com/lightbox/ImageViewing/components/ImageItem/ImageItem.ios.tsx
··· 228 228 accessibilityHint="" 229 229 enableLiveTextInteraction={showControls && !scaled} 230 230 accessibilityIgnoresInvertColors 231 - onLoad={e => { 232 - setHasLoaded(true) 233 - onLoad({width: e.source.width, height: e.source.height}) 234 - }} 231 + onLoad={ 232 + hasLoaded 233 + ? undefined 234 + : e => { 235 + setHasLoaded(true) 236 + onLoad({width: e.source.width, height: e.source.height}) 237 + } 238 + } 235 239 /> 236 240 </Animated.View> 237 241 </Animated.View>
+7 -3
src/view/com/util/images/AutoSizedImage.tsx
··· 113 113 accessibilityIgnoresInvertColors 114 114 accessibilityLabel={image.alt} 115 115 accessibilityHint="" 116 - onLoad={e => { 117 - setFetchedDims({width: e.source.width, height: e.source.height}) 118 - }} 116 + onLoad={ 117 + fetchedDims 118 + ? undefined 119 + : e => { 120 + setFetchedDims({width: e.source.width, height: e.source.height}) 121 + } 122 + } 119 123 /> 120 124 <MediaInsetBorder /> 121 125