mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
Fix warnings and errors
This commit is contained in:
@ -55,14 +55,9 @@ const GracefullyImage = ({
|
||||
const { colors } = useTheme()
|
||||
const [imageLoaded, setImageLoaded] = useState(false)
|
||||
|
||||
const [currentUri, setCurrentUri] = useState<string | undefined>(uri.original || uri.remote)
|
||||
const source = {
|
||||
uri: reduceMotionEnabled && uri.static ? uri.static : uri.original
|
||||
}
|
||||
const onLoad = () => {
|
||||
setImageLoaded(true)
|
||||
if (setImageDimensions && source.uri) {
|
||||
Image.getSize(source.uri, (width, height) => setImageDimensions({ width, height }))
|
||||
}
|
||||
uri: reduceMotionEnabled && uri.static ? uri.static : currentUri
|
||||
}
|
||||
|
||||
const blurhashView = () => {
|
||||
@ -92,11 +87,19 @@ const GracefullyImage = ({
|
||||
/>
|
||||
) : null}
|
||||
<FastImage
|
||||
source={{
|
||||
uri: reduceMotionEnabled && uri.static ? uri.static : uri.original
|
||||
}}
|
||||
source={source}
|
||||
style={[{ flex: 1 }, imageStyle]}
|
||||
onLoad={onLoad}
|
||||
onLoad={() => {
|
||||
setImageLoaded(true)
|
||||
if (setImageDimensions && source.uri) {
|
||||
Image.getSize(source.uri, (width, height) => setImageDimensions({ width, height }))
|
||||
}
|
||||
}}
|
||||
onError={() => {
|
||||
if (uri.original && uri.original === currentUri && uri.remote) {
|
||||
setCurrentUri(uri.remote)
|
||||
}
|
||||
}}
|
||||
/>
|
||||
{blurhashView()}
|
||||
</Pressable>
|
||||
|
Reference in New Issue
Block a user