mirror of
https://github.com/tooot-app/app
synced 2025-04-20 21:27:34 +02:00
Fix highlighted toot cannot be actioned
This commit is contained in:
parent
5ce7d50f8f
commit
c2aa78fef8
@ -74,7 +74,7 @@ const TabSharedToot: React.FC<TabSharedStackScreenProps<'Tab-Shared-Toot'>> = ({
|
|||||||
|
|
||||||
const match = urlMatcher(toot.url || toot.uri)
|
const match = urlMatcher(toot.url || toot.uri)
|
||||||
const highlightIndex = useRef<number>(0)
|
const highlightIndex = useRef<number>(0)
|
||||||
const query = useQuery<{ pages: { body: (Mastodon.Status & { _key?: 'cached' })[] }[] }>(
|
const query = useQuery<{ pages: { body: (Mastodon.Status & { key?: 'cached' })[] }[] }>(
|
||||||
queryKey.local,
|
queryKey.local,
|
||||||
async () => {
|
async () => {
|
||||||
const context = await apiInstance<{
|
const context = await apiInstance<{
|
||||||
@ -106,7 +106,7 @@ const TabSharedToot: React.FC<TabSharedStackScreenProps<'Tab-Shared-Toot'>> = ({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
initialData: { pages: [{ body: [{ ...toot, _level: 0, _key: 'cached' }] }] },
|
initialData: { pages: [{ body: [{ ...toot, _level: 0, key: 'cached' }] }] },
|
||||||
enabled: !toot._remote,
|
enabled: !toot._remote,
|
||||||
staleTime: 0,
|
staleTime: 0,
|
||||||
refetchOnMount: true,
|
refetchOnMount: true,
|
||||||
@ -205,7 +205,7 @@ const TabSharedToot: React.FC<TabSharedStackScreenProps<'Tab-Shared-Toot'>> = ({
|
|||||||
local => local.uri === remote.uri
|
local => local.uri === remote.uri
|
||||||
)
|
)
|
||||||
if (localMatch) {
|
if (localMatch) {
|
||||||
delete localMatch._key
|
delete localMatch.key
|
||||||
return localMatch
|
return localMatch
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
@ -263,7 +263,7 @@ const TabSharedToot: React.FC<TabSharedStackScreenProps<'Tab-Shared-Toot'>> = ({
|
|||||||
ref={flRef}
|
ref={flRef}
|
||||||
scrollEventThrottle={16}
|
scrollEventThrottle={16}
|
||||||
windowSize={7}
|
windowSize={7}
|
||||||
data={query.data.pages?.[0].body}
|
data={query.data?.pages?.[0].body}
|
||||||
renderItem={({ item, index }) => {
|
renderItem={({ item, index }) => {
|
||||||
const prev = query.data.pages[0].body[index - 1]?._level || 0
|
const prev = query.data.pages[0].body[index - 1]?._level || 0
|
||||||
const curr = item._level
|
const curr = item._level
|
||||||
|
Loading…
x
Reference in New Issue
Block a user