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:',
 | 
			
		||||
                  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"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user