1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Try to fix #16

This commit is contained in:
Zhiyuan Zheng
2021-02-13 01:26:02 +01:00
parent d2aec8d590
commit 4c8003b533
16 changed files with 195 additions and 51 deletions

View File

@ -20,17 +20,19 @@ import { useSelector } from 'react-redux'
export interface Props {
item: Mastodon.Status & { isPinned?: boolean }
queryKey?: QueryKeyTimeline
rootQueryKey?: QueryKeyTimeline
origin?: string
highlighted?: boolean
disableDetails?: boolean
disableOnPress?: boolean
pinned: Mastodon.Status['id'][]
pinned?: Mastodon.Status['id'][]
}
// When the poll is long
const TimelineDefault: React.FC<Props> = ({
item,
queryKey,
rootQueryKey,
origin,
highlighted = false,
disableDetails = false,
@ -55,7 +57,8 @@ const TimelineDefault: React.FC<Props> = ({
!disableOnPress &&
!highlighted &&
navigation.push('Tab-Shared-Toot', {
toot: actualStatus
toot: actualStatus,
rootQueryKey: queryKey
})
}, [])
@ -72,6 +75,7 @@ const TimelineDefault: React.FC<Props> = ({
}
]}
onPress={onPress}
disabled={queryKey && queryKey[1].toot !== undefined}
>
{item.reblog ? (
<TimelineActioned action='reblog' account={item.account} />
@ -86,6 +90,7 @@ const TimelineDefault: React.FC<Props> = ({
/>
<TimelineHeaderDefault
queryKey={disableOnPress ? undefined : queryKey}
rootQueryKey={disableOnPress ? undefined : rootQueryKey}
status={actualStatus}
/>
</View>
@ -109,6 +114,7 @@ const TimelineDefault: React.FC<Props> = ({
{queryKey && actualStatus.poll ? (
<TimelinePoll
queryKey={queryKey}
rootQueryKey={rootQueryKey}
statusId={actualStatus.id}
poll={actualStatus.poll}
reblog={item.reblog ? true : false}
@ -135,6 +141,7 @@ const TimelineDefault: React.FC<Props> = ({
>
<TimelineActions
queryKey={queryKey}
rootQueryKey={rootQueryKey}
status={actualStatus}
accts={([actualStatus.account] as Mastodon.Account[] &
Mastodon.Mention[])