Skip to content

Commit

Permalink
Merge pull request #11 from appwrite/lohanidamodar-patch-1
Browse files Browse the repository at this point in the history
Update storage.ts
  • Loading branch information
lohanidamodar committed Apr 2, 2024
2 parents 52a2645 + 9c4cee6 commit 096bb8e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/services/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { AppwriteException, Client } from '../client';
import type { Models } from '../models';
import type { UploadProgress, Payload } from '../client';
import * as FileSystem from 'expo-file-system';
import * as Device from 'expo-device'
import { Platform } from 'react-native';

export class Storage extends Service {

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

0 comments on commit 096bb8e

Please sign in to comment.