more fixes web + mobile
This commit is contained in:
@@ -7,10 +7,12 @@ export function uploadFileToFirebase({
|
||||
path,
|
||||
shouldCompress = false,
|
||||
fileType = "",
|
||||
blob: providedBlob = null,
|
||||
}) {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
try {
|
||||
let workingURI = uri;
|
||||
let uploadBlob = providedBlob;
|
||||
|
||||
// Optionally compress before upload
|
||||
try {
|
||||
@@ -30,10 +32,12 @@ export function uploadFileToFirebase({
|
||||
workingURI = uri;
|
||||
}
|
||||
|
||||
const response = await fetch(workingURI);
|
||||
const blob = await response.blob();
|
||||
if (!uploadBlob) {
|
||||
const response = await fetch(workingURI);
|
||||
uploadBlob = await response.blob();
|
||||
}
|
||||
|
||||
const uploadTask = firebase.storage().ref(path).put(blob);
|
||||
const uploadTask = firebase.storage().ref(path).put(uploadBlob);
|
||||
|
||||
uploadTask.on(
|
||||
Platform.OS === "web"
|
||||
|
||||
Reference in New Issue
Block a user