|
1 | | -import {Str} from 'expensify-common'; |
2 | | -import {Alert, Linking, Platform} from 'react-native'; |
| 1 | +import { Str } from 'expensify-common'; |
| 2 | +import { Alert, Linking, Platform } from 'react-native'; |
3 | 3 | import ImageSize from 'react-native-image-size'; |
4 | | -import type {TupleToUnion, ValueOf} from 'type-fest'; |
| 4 | +import type { TupleToUnion, ValueOf } from 'type-fest'; |
5 | 5 | import DateUtils from '@libs/DateUtils'; |
6 | 6 | import getPlatform from '@libs/getPlatform'; |
7 | | -import {translateLocal} from '@libs/Localize'; |
| 7 | +import { translateLocal } from '@libs/Localize'; |
8 | 8 | import Log from '@libs/Log'; |
9 | 9 | import saveLastRoute from '@libs/saveLastRoute'; |
10 | | -import type {FileObject} from '@pages/media/AttachmentModalScreen/types'; |
| 10 | +import type { FileObject } from '@pages/media/AttachmentModalScreen/types'; |
11 | 11 | import CONST from '@src/CONST'; |
12 | | -import type {TranslationPaths} from '@src/languages/types'; |
| 12 | +import type { TranslationPaths } from '@src/languages/types'; |
13 | 13 | import getImageManipulator from './getImageManipulator'; |
14 | 14 | import getImageResolution from './getImageResolution'; |
15 | | -import type {ReadFileAsync, SplitExtensionFromFileName} from './types'; |
| 15 | +import type { ReadFileAsync, SplitExtensionFromFileName } from './types'; |
| 16 | + |
16 | 17 |
|
17 | 18 | /** |
18 | 19 | * Show alert on successful attachment download |
@@ -406,8 +407,10 @@ const normalizeFileObject = (file: FileObject): Promise<FileObject> => { |
406 | 407 | } |
407 | 408 |
|
408 | 409 | const isAndroidNative = getPlatform() === CONST.PLATFORM.ANDROID; |
| 410 | + const isIOSNative = getPlatform() === CONST.PLATFORM.IOS; |
| 411 | + const isNativePlatform = isAndroidNative || isIOSNative; |
409 | 412 |
|
410 | | - if (!isAndroidNative || 'size' in file) { |
| 413 | + if (!isNativePlatform || 'size' in file) { |
411 | 414 | return Promise.resolve(file); |
412 | 415 | } |
413 | 416 |
|
|
0 commit comments