An ATproto social media client -- with an independent Appview.

Nicer error message for backend video too large error (#8596)

* nicer error message for backend video too large

* use same string for same error

authored by samuel.fm and committed by

GitHub 9ebfbd0e 74f7a44d

+12 -6
+12 -6
src/view/com/composer/state/video.ts
··· 1 - import {ImagePickerAsset} from 'expo-image-picker' 2 - import {AppBskyVideoDefs, BlobRef, BskyAgent} from '@atproto/api' 3 - import {JobStatus} from '@atproto/api/dist/client/types/app/bsky/video/defs' 4 - import {I18n} from '@lingui/core' 1 + import {type ImagePickerAsset} from 'expo-image-picker' 2 + import {type AppBskyVideoDefs, type BlobRef, type BskyAgent} from '@atproto/api' 3 + import {type JobStatus} from '@atproto/api/dist/client/types/app/bsky/video/defs' 4 + import {type I18n} from '@lingui/core' 5 5 import {msg} from '@lingui/macro' 6 6 7 7 import {AbortError} from '#/lib/async/cancelable' ··· 11 11 UploadLimitError, 12 12 VideoTooLargeError, 13 13 } from '#/lib/media/video/errors' 14 - import {CompressedVideo} from '#/lib/media/video/types' 14 + import {type CompressedVideo} from '#/lib/media/video/types' 15 15 import {uploadVideo} from '#/lib/media/video/upload' 16 16 import {createVideoAgent} from '#/lib/media/video/util' 17 17 import {logger} from '#/logger' ··· 392 392 return null 393 393 } 394 394 if (e instanceof VideoTooLargeError) { 395 - return _(msg`The selected video is larger than 100 MB.`) 395 + return _( 396 + msg`The selected video is larger than 100 MB. Please try again with a smaller file.`, 397 + ) 396 398 } 397 399 logger.error('Error compressing video', {safeMessage: e}) 398 400 return _(msg`An error occurred while compressing the video.`) ··· 427 429 case 'Account is not old enough to upload videos': 428 430 return _( 429 431 msg`Your account is not yet old enough to upload videos. Please try again later.`, 432 + ) 433 + case 'file size (100000001 bytes) is larger than the maximum allowed size (100000000 bytes)': 434 + return _( 435 + msg`The selected video is larger than 100 MB. Please try again with a smaller file.`, 430 436 ) 431 437 default: 432 438 return e.message