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>
|
||||
|
@ -126,7 +126,7 @@ const TimelineNotifications: React.FC<Props> = ({ notification, queryKey }) => {
|
||||
}
|
||||
|
||||
if (filterResults?.length && !filterRevealed) {
|
||||
return !filterResults.filter(result => result.filter_action === 'hide').length ? (
|
||||
return !filterResults.filter(result => result.filter_action === 'hide')?.length ? (
|
||||
<Pressable onPress={() => setFilterRevealed(!filterRevealed)}>
|
||||
<TimelineFiltered filterResults={filterResults} />
|
||||
</Pressable>
|
||||
|
@ -144,7 +144,7 @@ const TimelineRefresh: React.FC<Props> = ({
|
||||
>(queryKey)?.pages[0]
|
||||
|
||||
prevActive.current = true
|
||||
prevStatusId.current = firstPage?.body[0].id
|
||||
prevStatusId.current = firstPage?.body[0]?.id
|
||||
|
||||
await queryFunctionTimeline({
|
||||
queryKey,
|
||||
@ -182,7 +182,7 @@ const TimelineRefresh: React.FC<Props> = ({
|
||||
flRef.current?.scrollToOffset({ offset: scrollY.value - 15, animated: true })
|
||||
}
|
||||
|
||||
await new Promise(promise => setTimeout(promise, 32))
|
||||
await new Promise(promise => setTimeout(promise, 64))
|
||||
queryClient.setQueryData<
|
||||
InfiniteData<
|
||||
PagedResponse<(Mastodon.Status | Mastodon.Notification | Mastodon.Conversation)[]>
|
||||
|
Reference in New Issue
Block a user