mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
Fix some weird errors
This commit is contained in:
@ -54,7 +54,7 @@ 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 &&
|
||||
@ -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,15 +38,7 @@ const ProfileAvatarHeader: React.FC<Props> = ({ type, messageRef }) => {
|
||||
? { width: 400, height: 400 }
|
||||
: { width: 1500, height: 500 }
|
||||
})
|
||||
if (!image[0].uri) {
|
||||
displayMessage({
|
||||
ref: messageRef,
|
||||
message: t('screenTabs:me.profile.mediaSelectionFailed'),
|
||||
theme: theme,
|
||||
type: 'error'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (image[0].uri) {
|
||||
mutation.mutate({
|
||||
theme,
|
||||
messageRef,
|
||||
@ -58,6 +50,14 @@ const ProfileAvatarHeader: React.FC<Props> = ({ type, messageRef }) => {
|
||||
type,
|
||||
data: image[0].uri
|
||||
})
|
||||
} else {
|
||||
displayMessage({
|
||||
ref: messageRef,
|
||||
message: t('screenTabs:me.profile.mediaSelectionFailed'),
|
||||
theme: theme,
|
||||
type: 'error'
|
||||
})
|
||||
}
|
||||
}}
|
||||
/>
|
||||
)
|
||||
|
Reference in New Issue
Block a user