mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
Improve sharing error messaging
This commit is contained in:
@ -197,6 +197,13 @@ const Screens: React.FC<Props> = ({ localCorrupt }) => {
|
|||||||
'Image type not supported:',
|
'Image type not supported:',
|
||||||
mimeType.split('/')[1]
|
mimeType.split('/')[1]
|
||||||
)
|
)
|
||||||
|
displayMessage({
|
||||||
|
message: t('shareError.imageNotSupported', {
|
||||||
|
type: mimeType.split('/')[1]
|
||||||
|
}),
|
||||||
|
type: 'error',
|
||||||
|
theme
|
||||||
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
images.push({ type: mimeType.split('/')[1], uri: data })
|
images.push({ type: mimeType.split('/')[1], uri: data })
|
||||||
@ -206,6 +213,13 @@ const Screens: React.FC<Props> = ({ localCorrupt }) => {
|
|||||||
'Video type not supported:',
|
'Video type not supported:',
|
||||||
mimeType.split('/')[1]
|
mimeType.split('/')[1]
|
||||||
)
|
)
|
||||||
|
displayMessage({
|
||||||
|
message: t('shareError.videoNotSupported', {
|
||||||
|
type: mimeType.split('/')[1]
|
||||||
|
}),
|
||||||
|
type: 'error',
|
||||||
|
theme
|
||||||
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
video = { type: mimeType.split('/')[1], uri: data }
|
video = { type: mimeType.split('/')[1], uri: data }
|
||||||
@ -241,6 +255,13 @@ const Screens: React.FC<Props> = ({ localCorrupt }) => {
|
|||||||
'Image type not supported:',
|
'Image type not supported:',
|
||||||
item.mimeType.split('/')[1]
|
item.mimeType.split('/')[1]
|
||||||
)
|
)
|
||||||
|
displayMessage({
|
||||||
|
message: t('shareError.imageNotSupported', {
|
||||||
|
type: item.mimeType.split('/')[1]
|
||||||
|
}),
|
||||||
|
type: 'error',
|
||||||
|
theme
|
||||||
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
images.push({ type: item.mimeType.split('/')[1], uri: d })
|
images.push({ type: item.mimeType.split('/')[1], uri: d })
|
||||||
@ -250,6 +271,13 @@ const Screens: React.FC<Props> = ({ localCorrupt }) => {
|
|||||||
'Video type not supported:',
|
'Video type not supported:',
|
||||||
item.mimeType.split('/')[1]
|
item.mimeType.split('/')[1]
|
||||||
)
|
)
|
||||||
|
displayMessage({
|
||||||
|
message: t('shareError.videoNotSupported', {
|
||||||
|
type: item.mimeType.split('/')[1]
|
||||||
|
}),
|
||||||
|
type: 'error',
|
||||||
|
theme
|
||||||
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
video = { type: item.mimeType.split('/')[1], uri: d }
|
video = { type: item.mimeType.split('/')[1], uri: d }
|
||||||
|
@ -59,7 +59,7 @@ const displayMessage = ({
|
|||||||
|
|
||||||
if (ref) {
|
if (ref) {
|
||||||
ref.current?.showMessage({
|
ref.current?.showMessage({
|
||||||
duration: type === 'error' ? 5000 : duration === 'short' ? 1500 : 3000,
|
duration: type === 'error' ? 8000 : duration === 'short' ? 3000 : 5000,
|
||||||
autoHide,
|
autoHide,
|
||||||
message,
|
message,
|
||||||
description,
|
description,
|
||||||
|
@ -10,5 +10,9 @@
|
|||||||
"pushError": {
|
"pushError": {
|
||||||
"message": "Push service error",
|
"message": "Push service error",
|
||||||
"description": "Please re-enable push notification in settings"
|
"description": "Please re-enable push notification in settings"
|
||||||
|
},
|
||||||
|
"shareError": {
|
||||||
|
"imageNotSupported": "Image type {{type}} not supported",
|
||||||
|
"videoNotSupported": "Video type {{type}} not supported"
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user