Bluesky app fork with some witchin' additions 💫

[Drafts] Revert unnecessary gif changes (#9788)

* revert unnecessary gif changes

* Update ExternalEmbed.tsx

authored by samuel.fm and committed by

GitHub 0babd0f4 2cee96da

+13 -18
+10 -15
src/components/Post/Embed/ExternalEmbed/Gif.tsx
··· 1 - import React from 'react' 1 + import {useRef, useState} from 'react' 2 2 import { 3 3 Pressable, 4 4 type StyleProp, ··· 91 91 const {_} = useLingui() 92 92 const autoplayDisabled = useAutoplayDisabled() 93 93 94 - const playerRef = React.useRef<GifView>(null) 94 + const playerRef = useRef<GifView>(null) 95 95 96 - const [playerState, setPlayerState] = React.useState<{ 96 + const [playerState, setPlayerState] = useState<{ 97 97 isPlaying: boolean 98 98 isLoaded: boolean 99 99 }>({ ··· 101 101 isLoaded: false, 102 102 }) 103 103 104 - const onPlayerStateChange = React.useCallback( 105 - (e: GifViewStateChangeEvent) => { 106 - setPlayerState(e.nativeEvent) 107 - }, 108 - [], 109 - ) 104 + const onPlayerStateChange = (e: GifViewStateChangeEvent) => { 105 + setPlayerState(e.nativeEvent) 106 + } 110 107 111 - const onPress = React.useCallback(() => { 112 - playerRef.current?.toggleAsync() 113 - }, []) 108 + const onPress = () => { 109 + void playerRef.current?.toggleAsync() 110 + } 114 111 115 112 let aspectRatio = 1 116 113 if (params.dimensions) { 117 114 const ratio = params.dimensions.width / params.dimensions.height 118 - if (!isNaN(ratio) && isFinite(ratio)) { 119 - aspectRatio = clamp(ratio, 0.75, 4) 120 - } 115 + aspectRatio = clamp(ratio, 0.75, 4) 121 116 } 122 117 123 118 return (
+3 -3
src/view/com/composer/ExternalEmbed.tsx
··· 1 - import React from 'react' 1 + import {useMemo} from 'react' 2 2 import {type StyleProp, View, type ViewStyle} from 'react-native' 3 3 4 4 import {cleanError} from '#/lib/strings/errors' ··· 25 25 }) => { 26 26 const t = useTheme() 27 27 const {data, error} = useResolveGifQuery(gif) 28 - const linkInfo = React.useMemo( 28 + const linkInfo = useMemo( 29 29 () => 30 30 data && { 31 31 title: data.title ?? data.uri, ··· 83 83 }) => { 84 84 const t = useTheme() 85 85 const {data, error} = useResolveLinkQuery(uri) 86 - const linkComponent = React.useMemo(() => { 86 + const linkComponent = useMemo(() => { 87 87 if (data) { 88 88 if (data.type === 'external') { 89 89 return (