Skip to content

Commit

Permalink
windows: import rn-fetch-blob on Windows
Browse files Browse the repository at this point in the history
Import rn-fetch-blob on all supported OSes.
  • Loading branch information
jaimecbernardo committed Feb 10, 2021
1 parent 5549125 commit 07f3d85
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions index.js
Expand Up @@ -21,15 +21,18 @@ import {
import { ProgressBar } from '@react-native-community/progress-bar-android'
import { ProgressView } from '@react-native-community/progress-view'

let RNFetchBlob = {
fs : {
dirs: {
CacheDir: ''
}
}
};
if (Platform.OS !== 'windows') {
let RNFetchBlob;
try {
RNFetchBlob = require('rn-fetch-blob').default;
} catch(e) {
// For Windows, when not using rn-fetch-blob with Windows support.
RNFetchBlob = {
fs : {
dirs: {
CacheDir: ''
}
}
};
}

const SHA1 = require('crypto-js/sha1');
Expand Down

0 comments on commit 07f3d85

Please sign in to comment.