mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
Fix toot action for #638
This commit is contained in:
@ -11,7 +11,7 @@ import Icon from './Icon'
|
||||
import CustomText from './Text'
|
||||
|
||||
export interface Props {
|
||||
account: Partial<Mastodon.Account> & Pick<Mastodon.Account, 'id' | 'acct' | 'username'>
|
||||
account: Partial<Mastodon.Account> & Pick<Mastodon.Account, 'id' | 'acct' | 'username' | 'url'>
|
||||
props?: PressableProps
|
||||
}
|
||||
|
||||
|
@ -168,10 +168,7 @@ const ParseHTML: React.FC<Props> = ({
|
||||
matchedMention &&
|
||||
!disableDetails &&
|
||||
!sameAccount &&
|
||||
navigation.push('Tab-Shared-Account', {
|
||||
account: matchedMention,
|
||||
isRemote: status?._remote
|
||||
})
|
||||
navigation.push('Tab-Shared-Account', { account: matchedMention })
|
||||
}
|
||||
children={node.children.map(unwrapNode).join('')}
|
||||
/>
|
||||
|
@ -37,7 +37,6 @@ export interface Props {
|
||||
disableDetails?: boolean
|
||||
disableOnPress?: boolean
|
||||
isConversation?: boolean
|
||||
isRemote?: boolean
|
||||
}
|
||||
|
||||
// When the poll is long
|
||||
@ -48,8 +47,7 @@ const TimelineDefault: React.FC<Props> = ({
|
||||
highlighted = false,
|
||||
disableDetails = false,
|
||||
disableOnPress = false,
|
||||
isConversation = false,
|
||||
isRemote = false
|
||||
isConversation = false
|
||||
}) => {
|
||||
const status = item.reblog ? item.reblog : item
|
||||
const rawContent = useRef<string[]>([])
|
||||
@ -177,7 +175,7 @@ const TimelineDefault: React.FC<Props> = ({
|
||||
disableDetails,
|
||||
disableOnPress,
|
||||
isConversation,
|
||||
isRemote
|
||||
isRemote: item._remote
|
||||
}}
|
||||
>
|
||||
{disableOnPress ? (
|
||||
|
@ -38,7 +38,7 @@ const TimelineActioned: React.FC<Props> = ({ action, isNotification, ...rest })
|
||||
)
|
||||
|
||||
const onPress = () =>
|
||||
navigation.push('Tab-Shared-Account', { account, isRemote: status?._remote })
|
||||
navigation.push('Tab-Shared-Account', { account })
|
||||
|
||||
const children = () => {
|
||||
switch (action) {
|
||||
|
@ -114,7 +114,8 @@ const TimelineActions: React.FC = () => {
|
||||
status,
|
||||
payload: {
|
||||
type: 'reblogged',
|
||||
visibility: 'public'
|
||||
visibility: 'public',
|
||||
to: true
|
||||
}
|
||||
})
|
||||
break
|
||||
@ -126,7 +127,8 @@ const TimelineActions: React.FC = () => {
|
||||
status,
|
||||
payload: {
|
||||
type: 'reblogged',
|
||||
visibility: 'unlisted'
|
||||
visibility: 'unlisted',
|
||||
to: true
|
||||
}
|
||||
})
|
||||
break
|
||||
@ -141,7 +143,8 @@ const TimelineActions: React.FC = () => {
|
||||
status,
|
||||
payload: {
|
||||
type: 'reblogged',
|
||||
visibility: 'public'
|
||||
visibility: 'public',
|
||||
to: false
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -153,7 +156,8 @@ const TimelineActions: React.FC = () => {
|
||||
rootQueryKey,
|
||||
status,
|
||||
payload: {
|
||||
type: 'favourited'
|
||||
type: 'favourited',
|
||||
to: !status.favourited
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -164,7 +168,8 @@ const TimelineActions: React.FC = () => {
|
||||
rootQueryKey,
|
||||
status,
|
||||
payload: {
|
||||
type: 'bookmarked'
|
||||
type: 'bookmarked',
|
||||
to: !status.bookmarked
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ const TimelineAvatar: React.FC<Props> = ({ account }) => {
|
||||
})}
|
||||
onPress={() =>
|
||||
!disableOnPress &&
|
||||
navigation.push('Tab-Shared-Account', { account: actualAccount, isRemote: status?._remote })
|
||||
navigation.push('Tab-Shared-Account', { account: actualAccount })
|
||||
}
|
||||
uri={{ original: actualAccount.avatar, static: actualAccount.avatar_static }}
|
||||
dimension={
|
||||
|
@ -86,7 +86,8 @@ const TimelineCard: React.FC = () => {
|
||||
}, [])
|
||||
|
||||
const accountQuery = useAccountQuery({
|
||||
id: isAccount?.style === 'default' ? isAccount.id : '',
|
||||
account:
|
||||
isAccount?.style === 'default' ? { id: isAccount.id, url: status.card.url } : undefined,
|
||||
options: { enabled: false }
|
||||
})
|
||||
useEffect(() => {
|
||||
|
@ -30,7 +30,7 @@ const menuAccount = ({
|
||||
}: {
|
||||
type: 'status' | 'account' // Where the action is coming from
|
||||
openChange: boolean
|
||||
account?: Partial<Mastodon.Account> & Pick<Mastodon.Account, 'id' | 'username' | 'acct'>
|
||||
account?: Partial<Mastodon.Account> & Pick<Mastodon.Account, 'id' | 'username' | 'acct' | 'url'>
|
||||
status?: Mastodon.Status
|
||||
queryKey?: QueryKeyTimeline
|
||||
rootQueryKey?: QueryKeyTimeline
|
||||
@ -47,10 +47,7 @@ const menuAccount = ({
|
||||
setEnabled(true)
|
||||
}
|
||||
}, [openChange, enabled])
|
||||
const { data: fetchedAccount } = useAccountQuery({
|
||||
remoteUrl: account?.url,
|
||||
options: { enabled: !!status?._remote && enabled }
|
||||
})
|
||||
const { data: fetchedAccount } = useAccountQuery({ account, options: { enabled } })
|
||||
const actualAccount = status?._remote ? fetchedAccount : account
|
||||
const { data, isFetched } = useRelationshipQuery({
|
||||
id: actualAccount?.id,
|
||||
|
@ -197,7 +197,8 @@ const menuStatus = ({
|
||||
rootQueryKey,
|
||||
status,
|
||||
payload: {
|
||||
type: 'muted'
|
||||
type: 'muted',
|
||||
to: !status.muted
|
||||
}
|
||||
}),
|
||||
disabled: false,
|
||||
@ -221,7 +222,8 @@ const menuStatus = ({
|
||||
rootQueryKey,
|
||||
status,
|
||||
payload: {
|
||||
type: 'pinned'
|
||||
type: 'pinned',
|
||||
to: !status.pinned
|
||||
}
|
||||
}),
|
||||
disabled: status.visibility !== 'public' && status.visibility !== 'unlisted',
|
||||
|
Reference in New Issue
Block a user