1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00
1. Added more notification types
2. Use `react-native-reanimated` v2
This commit is contained in:
Zhiyuan Zheng
2021-01-04 10:50:24 +01:00
parent dceaf8d25c
commit e9ea0ed71e
47 changed files with 956 additions and 700 deletions

View File

@ -18,6 +18,7 @@ const HeaderDefaultActionsAccount: React.FC<Props> = ({
setBottomSheetVisible
}) => {
const { t } = useTranslation()
const queryClient = useQueryClient()
const fireMutation = useCallback(
async ({ type }: { type: 'mute' | 'block' | 'reports' }) => {
@ -57,7 +58,7 @@ const HeaderDefaultActionsAccount: React.FC<Props> = ({
})
})
},
onError: (_, { type }) => {
onError: (err: any, { type }) => {
haptics('Error')
toast({
type: 'error',
@ -66,7 +67,14 @@ const HeaderDefaultActionsAccount: React.FC<Props> = ({
`timeline:shared.header.default.actions.account.${type}.function`,
{ acct: account.acct }
)
})
}),
...(err.status &&
typeof err.status === 'number' &&
err.data &&
err.data.error &&
typeof err.data.error === 'string' && {
description: err.data.error
})
})
},
onSettled: () => {