Minor cleanup.
This commit is contained in:
@@ -22,7 +22,7 @@ export const handleUpload = async (ev, context) => {
|
||||
).blob();
|
||||
let extension = imageData.localUri.split(".").pop();
|
||||
|
||||
//Default to Cloudinary in case of split treatment errors.
|
||||
//Default to Cloudinary in case of split treatment errors.
|
||||
let destination =
|
||||
splitClient?.getTreatment("Imgproxy") === "on" ? "imgproxy" : "cloudinary";
|
||||
|
||||
@@ -135,7 +135,6 @@ export const uploadToImgproxy = async (
|
||||
},
|
||||
};
|
||||
|
||||
console.log("Uploading to S3", key, preSignedUploadUrlToS3, file, options);
|
||||
const formData = new FormData();
|
||||
formData.append("file", {
|
||||
uri: imageData.localUri,
|
||||
@@ -149,8 +148,8 @@ export const uploadToImgproxy = async (
|
||||
file,
|
||||
options
|
||||
);
|
||||
debugger;
|
||||
console.log(s3UploadResponse);
|
||||
|
||||
|
||||
} catch (error) {
|
||||
console.log("Error uploading to S3", error.message, error.stack);
|
||||
Sentry.Native.captureException(error);
|
||||
|
||||
@@ -2,7 +2,7 @@ import axios from "axios";
|
||||
import { store } from "../redux/store";
|
||||
import mime from "mime";
|
||||
import * as MediaLibrary from "expo-media-library";
|
||||
import * as Sentry from '@sentry/react-native';
|
||||
import * as Sentry from "@sentry/react-native";
|
||||
|
||||
axios.interceptors.request.use(
|
||||
function (config) {
|
||||
@@ -45,8 +45,9 @@ export const handleLocalUpload = async ({
|
||||
ims_token: bodyshop.localmediatoken,
|
||||
},
|
||||
onUploadProgress: (e) => {
|
||||
if (onProgress)
|
||||
if (onProgress) {
|
||||
onProgress({ percent: e.loaded / e.total, loaded: e.loaded });
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user