1
0
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:
xmflsct
2022-08-19 11:58:49 +02:00
parent 16dfcec9f2
commit 1507059241
2 changed files with 17 additions and 17 deletions

View File

@ -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[] = [

View File

@ -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'
})
}
}}
/>
)