mirror of https://github.com/tooot-app/app
Fix #610
This commit is contained in:
parent
f3c40e9486
commit
3594500b3e
|
@ -33,7 +33,7 @@ const RelationshipIncoming: React.FC<Props> = ({ id }) => {
|
|||
type: 'error',
|
||||
theme,
|
||||
message: t('common:message.error.message', {
|
||||
function: t(`componentRelationship:${type}.function`)
|
||||
function: t(`componentRelationship:${type}.function` as any)
|
||||
}),
|
||||
...(err.status &&
|
||||
typeof err.status === 'number' &&
|
||||
|
|
|
@ -44,7 +44,7 @@ const RelationshipOutgoing: React.FC<Props> = ({ id }: Props) => {
|
|||
theme,
|
||||
type: 'error',
|
||||
message: t('common:message.error.message', {
|
||||
function: t(`componentRelationship:${action}.function`)
|
||||
function: t(`componentRelationship:${action}.function` as any)
|
||||
}),
|
||||
...(err.status &&
|
||||
typeof err.status === 'number' &&
|
||||
|
|
|
@ -60,7 +60,9 @@ const TimelineActions: React.FC = () => {
|
|||
theme,
|
||||
type: 'error',
|
||||
message: t('common:message.error.message', {
|
||||
function: t(`componentTimeline:shared.actions.${correctParam.payload.property}.function`)
|
||||
function: t(
|
||||
`componentTimeline:shared.actions.${correctParam.payload.property}.function` as any
|
||||
)
|
||||
}),
|
||||
...(err.status &&
|
||||
typeof err.status === 'number' &&
|
||||
|
|
|
@ -158,6 +158,7 @@ const menuAccount = ({
|
|||
: 'person.badge.minus'
|
||||
})
|
||||
}
|
||||
|
||||
if (!ownAccount) {
|
||||
menus[0].push({
|
||||
key: 'account-list',
|
||||
|
@ -170,6 +171,25 @@ const menuAccount = ({
|
|||
title: t('componentContextMenu:account.inLists'),
|
||||
icon: 'checklist'
|
||||
})
|
||||
menus[0].push({
|
||||
key: 'account-show-boosts',
|
||||
item: {
|
||||
onSelect: () =>
|
||||
relationshipMutation.mutate({
|
||||
id: account.id,
|
||||
type: 'outgoing',
|
||||
payload: { action: 'follow', state: false, reblogs: !data?.showing_reblogs }
|
||||
}),
|
||||
disabled: Platform.OS !== 'android' ? !data || !isFetched : false,
|
||||
destructive: false,
|
||||
hidden: !isFetched || !data?.following
|
||||
},
|
||||
title: t('componentContextMenu:account.showBoosts.action', {
|
||||
defaultValue: 'false',
|
||||
context: (data?.showing_reblogs || false).toString()
|
||||
}),
|
||||
icon: data?.showing_reblogs ? 'rectangle.on.rectangle.slash' : 'rectangle.on.rectangle'
|
||||
})
|
||||
menus[0].push({
|
||||
key: 'account-mute',
|
||||
item: {
|
||||
|
@ -190,9 +210,7 @@ const menuAccount = ({
|
|||
}),
|
||||
icon: data?.muting ? 'eye' : 'eye.slash'
|
||||
})
|
||||
}
|
||||
|
||||
!ownAccount &&
|
||||
menus.push([
|
||||
{
|
||||
key: 'account-block',
|
||||
|
@ -240,6 +258,7 @@ const menuAccount = ({
|
|||
icon: 'flag'
|
||||
}
|
||||
])
|
||||
}
|
||||
|
||||
return menus
|
||||
}
|
||||
|
|
|
@ -7,6 +7,10 @@
|
|||
"action_true": "Unfollow user"
|
||||
},
|
||||
"inLists": "Manage user of lists",
|
||||
"showBoosts": {
|
||||
"action_false": "Show user's boosts",
|
||||
"action_true": "Hide users's boosts"
|
||||
},
|
||||
"mute": {
|
||||
"action_false": "Mute user",
|
||||
"action_true": "Unmute user"
|
||||
|
|
|
@ -183,7 +183,7 @@ const TabSharedAccount: React.FC<TabSharedStackScreenProps<'Tab-Shared-Account'>
|
|||
ListHeaderComponent,
|
||||
maintainVisibleContentPosition: undefined,
|
||||
onRefresh: () => queryClient.refetchQueries(queryKey),
|
||||
refreshing: queryClient.getQueryState(queryKey)?.fetchStatus === 'fetching'
|
||||
refreshing: false
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
|
|
@ -48,6 +48,7 @@ type MutationVarsRelationship =
|
|||
payload: {
|
||||
action: 'block'
|
||||
state: boolean
|
||||
reblogs?: undefined
|
||||
notify?: undefined
|
||||
}
|
||||
}
|
||||
|
@ -57,6 +58,7 @@ type MutationVarsRelationship =
|
|||
payload: {
|
||||
action: 'follow'
|
||||
state: boolean
|
||||
reblogs?: boolean
|
||||
notify?: boolean
|
||||
}
|
||||
}
|
||||
|
@ -70,6 +72,8 @@ const mutationFunction = async (params: MutationVarsRelationship) => {
|
|||
}).then(res => res.body)
|
||||
case 'outgoing':
|
||||
const formData = new FormData()
|
||||
typeof params.payload.reblogs === 'boolean' &&
|
||||
formData.append('reblogs', params.payload.reblogs.toString())
|
||||
typeof params.payload.notify === 'boolean' &&
|
||||
formData.append('notify', params.payload.notify.toString())
|
||||
|
||||
|
|
Loading…
Reference in New Issue