mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
Fix #734
This commit is contained in:
@ -17,6 +17,7 @@ export type Props = {
|
||||
loading?: boolean
|
||||
disabled?: boolean
|
||||
destructive?: boolean
|
||||
destructiveColor?: string
|
||||
|
||||
onPress: () => void
|
||||
} & ({ type?: undefined; content: IconName } | { type: 'text'; content: string })
|
||||
@ -34,6 +35,7 @@ const HeaderRight: React.FC<Props> = ({
|
||||
loading,
|
||||
disabled,
|
||||
destructive = false,
|
||||
destructiveColor,
|
||||
onPress
|
||||
}) => {
|
||||
const { colors } = useTheme()
|
||||
@ -57,7 +59,7 @@ const HeaderRight: React.FC<Props> = ({
|
||||
color: disabled
|
||||
? colors.secondary
|
||||
: destructive
|
||||
? colors.red
|
||||
? destructiveColor || colors.red
|
||||
: colors.primaryDefault,
|
||||
opacity: loading ? 0 : 1
|
||||
}}
|
||||
|
@ -4,6 +4,7 @@ import { useNavigation } from '@react-navigation/native'
|
||||
import { NativeStackNavigationProp } from '@react-navigation/native-stack'
|
||||
import { useQueryClient } from '@tanstack/react-query'
|
||||
import apiInstance from '@utils/api/instance'
|
||||
import { featureCheck } from '@utils/helpers/featureCheck'
|
||||
import { checkIsMyAccount } from '@utils/helpers/isMyAccount'
|
||||
import { TabSharedStackParamList, useNavState } from '@utils/navigation/navigators'
|
||||
import { useAccountQuery } from '@utils/queryHooks/account'
|
||||
@ -203,13 +204,21 @@ const menuAccount = ({
|
||||
type: 'item',
|
||||
key: 'account-mute',
|
||||
props: {
|
||||
onSelect: () =>
|
||||
actualAccount &&
|
||||
timelineMutation.mutate({
|
||||
type: 'updateAccountProperty',
|
||||
id: actualAccount.id,
|
||||
payload: { property: 'mute', currentValue: data?.muting }
|
||||
}),
|
||||
onSelect: () => {
|
||||
if (actualAccount) {
|
||||
if (data?.muting !== true) {
|
||||
if (featureCheck('mute_duration')) {
|
||||
navigation.navigate('Tab-Shared-Mute', { account: actualAccount })
|
||||
}
|
||||
}
|
||||
|
||||
timelineMutation.mutate({
|
||||
type: 'updateAccountProperty',
|
||||
id: actualAccount.id,
|
||||
payload: { property: 'mute', currentValue: data?.muting }
|
||||
})
|
||||
}
|
||||
},
|
||||
disabled: Platform.OS !== 'android' ? !data || !isFetched : false,
|
||||
destructive: false,
|
||||
hidden: false
|
||||
|
Reference in New Issue
Block a user