Skip to content

Commit 096bb8e

Browse files
Merge pull request #11 from appwrite/lohanidamodar-patch-1
Update storage.ts
2 parents 52a2645 + 9c4cee6 commit 096bb8e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/services/storage.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { AppwriteException, Client } from '../client';
33
import type { Models } from '../models';
44
import type { UploadProgress, Payload } from '../client';
55
import * as FileSystem from 'expo-file-system';
6-
import * as Device from 'expo-device'
6+
import { Platform } from 'react-native';
77

88
export class Storage extends Service {
99

@@ -141,7 +141,7 @@ export class Storage extends Service {
141141
length: Service.CHUNK_SIZE
142142
});
143143
var path = `data:${file.type};base64,${chunk}`;
144-
if (Device.osName == 'Android') {
144+
if (Platform.os.toLowerCase() == 'android') {
145145
path = FileSystem.cacheDirectory + '/tmp_chunk';
146146
await FileSystem.writeAsStringAsync(path, chunk, {encoding: FileSystem.EncodingType.Base64});
147147
}

0 commit comments

Comments
 (0)