diff --git a/package.json b/package.json index 36c637e7..077a8776 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tooot", - "version": "4.8.1", + "version": "4.8.0", "description": "tooot for Mastodon", "author": "xmflsct ", "license": "GPL-3.0-or-later", diff --git a/src/components/GracefullyImage.tsx b/src/components/GracefullyImage.tsx index 73e55820..e7069c68 100644 --- a/src/components/GracefullyImage.tsx +++ b/src/components/GracefullyImage.tsx @@ -1,6 +1,6 @@ import { useAccessibility } from '@utils/accessibility/AccessibilityManager' import { useTheme } from '@utils/styles/ThemeManager' -import React, { useState } from 'react' +import React, { useEffect, useState } from 'react' import { AccessibilityProps, Image, @@ -59,6 +59,11 @@ const GracefullyImage = ({ const source = { uri: reduceMotionEnabled && uri.static ? uri.static : currentUri } + useEffect(() => { + if (currentUri !== uri.original && currentUri !== uri.remote) { + setCurrentUri(uri.original || uri.remote) + } + }, [currentUri, uri.original, uri.remote]) const blurhashView = () => { if (hidden || !imageLoaded) { diff --git a/src/screens/Tabs/Local/Root.tsx b/src/screens/Tabs/Local/Root.tsx index 465ec22d..50eeea19 100644 --- a/src/screens/Tabs/Local/Root.tsx +++ b/src/screens/Tabs/Local/Root.tsx @@ -55,7 +55,7 @@ const Root: React.FC - {page.page === 'Following' && !pageLocal.showBoosts ? ( + {page.page === 'Following' && !pageLocal?.showBoosts ? ( ) : null} - {page.page === 'Following' && !pageLocal.showReplies ? ( + {page.page === 'Following' && !pageLocal?.showReplies ? ( { setQueryKey([ 'Timeline', { page: 'Following', - showBoosts: !pageLocal.showBoosts, - showReplies: pageLocal.showReplies + showBoosts: !pageLocal?.showBoosts, + showReplies: pageLocal?.showReplies } ]) setAccountStorage([ { key: 'page_local', - value: { ...pageLocal, showBoosts: !pageLocal.showBoosts } + value: { ...pageLocal, showBoosts: !pageLocal?.showBoosts } } ]) }} @@ -117,20 +117,20 @@ const Root: React.FC { setQueryKey([ 'Timeline', { page: 'Following', - showBoosts: pageLocal.showBoosts, - showReplies: !pageLocal.showReplies + showBoosts: pageLocal?.showBoosts, + showReplies: !pageLocal?.showReplies } ]) setAccountStorage([ { key: 'page_local', - value: { ...pageLocal, showReplies: !pageLocal.showReplies } + value: { ...pageLocal, showReplies: !pageLocal?.showReplies } } ]) }} diff --git a/src/screens/Tabs/Shared/Toot.tsx b/src/screens/Tabs/Shared/Toot.tsx index 9748fceb..a48e9202 100644 --- a/src/screens/Tabs/Shared/Toot.tsx +++ b/src/screens/Tabs/Shared/Toot.tsx @@ -198,16 +198,12 @@ const TabSharedToot: React.FC> = ({ queryClient.setQueryData<{ pages: { body: Mastodon.Status[] }[] }>(queryKey.local, old => { - if (!old) return old - setHasRemoteContent(true) return { pages: [ { body: data.map(remote => { - const localMatch = query.data?.pages[0].body.find( - local => local.uri === remote.uri - ) + const localMatch = old?.pages[0].body.find(local => local.uri === remote.uri) if (localMatch) { return { ...localMatch, _level: remote._level } } else {