Skip to content

Commit 5ca5b58

Browse files
committed
Merge branch 'develop'
2 parents d3ef361 + d07c568 commit 5ca5b58

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

packages/uikit-react-native-core/src/platform/createFileService.native.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -159,17 +159,12 @@ const createNativeFileService = ({
159159
await fsModule.FileSystem.fetch(options.fileUrl, { path: downloadPath });
160160

161161
const fileType = getFileType(getFileExtension(options.fileUrl));
162-
const dirType = {
163-
'file': 'downloads',
164-
'audio': 'audio',
165-
'image': 'images',
166-
'video': 'video',
167-
} as const;
168162

169-
if (Platform.OS === 'ios') {
163+
if (Platform.OS === 'ios' && fileType.match(/audio|video/)) {
170164
await mediaLibraryModule.save(downloadPath);
171165
}
172166
if (Platform.OS === 'android') {
167+
const dirType = { 'file': 'downloads', 'audio': 'audio', 'image': 'images', 'video': 'video' } as const;
173168
await fsModule.FileSystem.cpExternal(downloadPath, options.fileName, dirType[fileType]);
174169
}
175170
return downloadPath;

0 commit comments

Comments
 (0)