1
0
mirror of https://github.com/tooot-app/app synced 2025-01-20 13:10:15 +01:00
This commit is contained in:
xmflsct 2022-08-19 11:53:16 +02:00
parent 88bafcc1e0
commit 16dfcec9f2

View File

@ -32,7 +32,7 @@ const contextMenuAccount = ({
const { t } = useTranslation('componentContextMenu') const { t } = useTranslation('componentContextMenu')
const queryClient = useQueryClient() const queryClient = useQueryClient()
const mutateion = useTimelineMutation({ const mutation = useTimelineMutation({
onSuccess: (_, params) => { onSuccess: (_, params) => {
queryClient.refetchQueries(['Relationship', { id: accountId }]) queryClient.refetchQueries(['Relationship', { id: accountId }])
const theParams = params as MutationVarsTimelineUpdateAccountProperty const theParams = params as MutationVarsTimelineUpdateAccountProperty
@ -65,8 +65,8 @@ const contextMenuAccount = ({
err.data && err.data &&
err.data.error && err.data.error &&
typeof err.data.error === 'string' && { typeof err.data.error === 'string' && {
description: err.data.error description: err.data.error
}) })
}) })
}, },
onSettled: () => { onSettled: () => {
@ -117,7 +117,7 @@ const contextMenuAccount = ({
analytics('timeline_shared_headeractions_account_mute_press', { analytics('timeline_shared_headeractions_account_mute_press', {
page: queryKey && queryKey[1].page page: queryKey && queryKey[1].page
}) })
mutateion.mutate({ mutation.mutate({
type: 'updateAccountProperty', type: 'updateAccountProperty',
queryKey, queryKey,
id: accountId, id: accountId,
@ -128,18 +128,18 @@ const contextMenuAccount = ({
analytics('timeline_shared_headeractions_account_block_press', { analytics('timeline_shared_headeractions_account_block_press', {
page: queryKey && queryKey[1].page page: queryKey && queryKey[1].page
}) })
mutateion.mutate({ mutation.mutate({
type: 'updateAccountProperty', type: 'updateAccountProperty',
queryKey, queryKey,
id: accountId, id: accountId,
payload: { property: 'block', currentValue: relationship?.blocking } payload: { property: 'block', currentValue: relationship?.blocking }
}) })
} }
if (actions[index].id === 'account-report') { if (actions[index].id === 'account-reports') {
analytics('timeline_shared_headeractions_account_reports_press', { analytics('timeline_shared_headeractions_account_reports_press', {
page: queryKey && queryKey[1].page page: queryKey && queryKey[1].page
}) })
mutateion.mutate({ mutation.mutate({
type: 'updateAccountProperty', type: 'updateAccountProperty',
queryKey, queryKey,
id: accountId, id: accountId,