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:
@ -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