-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55321 from CyberAndrii/55240-Improve-checks-for-r…
…eceipt-file-detection
- Loading branch information
Showing
4 changed files
with
25 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import type {FileObject} from '@components/AttachmentModal'; | ||
|
||
function isFileUploadable(file: FileObject | undefined): boolean { | ||
// Native platforms only require the object to include the `uri` property. | ||
// Optionally, it can also have a `name` and `type` properties. | ||
// On other platforms, the file must be an instance of `Blob` or one of its subclasses. | ||
return !!file && 'uri' in file && !!file.uri && typeof file.uri === 'string'; | ||
} | ||
|
||
export default isFileUploadable; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import type {FileObject} from '@components/AttachmentModal'; | ||
|
||
function isFileUploadable(file: FileObject | undefined): boolean { | ||
return file instanceof Blob; | ||
} | ||
|
||
export default isFileUploadable; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters