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