Skip to content

Commit

Permalink
Fix weird Android image upload issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Li committed Aug 18, 2023
1 parent 5875061 commit 55a66a3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/libs/fileDownload/FileUtils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Alert, Linking} from 'react-native';
import {Alert, Linking, Platform} from 'react-native';
import CONST from '../../CONST';
import * as Localize from '../Localize';
import DateUtils from '../DateUtils';
Expand Down Expand Up @@ -146,7 +146,10 @@ const readFileAsync = (path, fileName) =>

return fetch(path)
.then((res) => {
if (!res.ok) {
// For some reason, fetch is "Unable to read uploaded file"
// on Android even though the blob is returned, so we'll ignore
// in that case
if (!res.ok && Platform.OS !== 'android') {
throw Error(res.statusText);
}
return res.blob();
Expand Down

0 comments on commit 55a66a3

Please sign in to comment.