mirror of
https://github.com/tooot-app/app
synced 2025-01-03 13:10:23 +01:00
Fix some weird errors
This commit is contained in:
parent
16dfcec9f2
commit
1507059241
@ -54,13 +54,13 @@ const contextMenuStatus = ({
|
||||
message: t('common:message.error.message', {
|
||||
function: t(`status.${theFunction}.action`)
|
||||
}),
|
||||
...(err.status &&
|
||||
...(err?.status &&
|
||||
typeof err.status === 'number' &&
|
||||
err.data &&
|
||||
err.data.error &&
|
||||
typeof err.data.error === 'string' && {
|
||||
description: err.data.error
|
||||
})
|
||||
description: err.data.error
|
||||
})
|
||||
})
|
||||
queryClient.setQueryData(queryKey, oldData)
|
||||
}
|
||||
@ -70,7 +70,7 @@ const contextMenuStatus = ({
|
||||
getInstanceAccount,
|
||||
(prev, next) => prev.id === next.id
|
||||
)
|
||||
const ownAccount = instanceAccount?.id === status?.account.id
|
||||
const ownAccount = instanceAccount?.id === status?.account?.id
|
||||
|
||||
if (ownAccount) {
|
||||
const accountMenuItems: ContextMenuAction[] = [
|
||||
|
@ -38,26 +38,26 @@ const ProfileAvatarHeader: React.FC<Props> = ({ type, messageRef }) => {
|
||||
? { width: 400, height: 400 }
|
||||
: { width: 1500, height: 500 }
|
||||
})
|
||||
if (!image[0].uri) {
|
||||
if (image[0].uri) {
|
||||
mutation.mutate({
|
||||
theme,
|
||||
messageRef,
|
||||
message: {
|
||||
text: `me.profile.root.${type}.title`,
|
||||
succeed: true,
|
||||
failed: true
|
||||
},
|
||||
type,
|
||||
data: image[0].uri
|
||||
})
|
||||
} else {
|
||||
displayMessage({
|
||||
ref: messageRef,
|
||||
message: t('screenTabs:me.profile.mediaSelectionFailed'),
|
||||
theme: theme,
|
||||
type: 'error'
|
||||
})
|
||||
return
|
||||
}
|
||||
mutation.mutate({
|
||||
theme,
|
||||
messageRef,
|
||||
message: {
|
||||
text: `me.profile.root.${type}.title`,
|
||||
succeed: true,
|
||||
failed: true
|
||||
},
|
||||
type,
|
||||
data: image[0].uri
|
||||
})
|
||||
}}
|
||||
/>
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user