diff --git a/App.js b/App.js index e2fa215..f4994c4 100644 --- a/App.js +++ b/App.js @@ -32,7 +32,7 @@ Sentry.init({ // // ... other options // }), // ], - debug: true, // Sentry will try to print out useful debugging information if something goes wrong with sending an event. Set this to `false` in production. + //debug: true, // Sentry will try to print out useful debugging information if something goes wrong with sending an event. Set this to `false` in production. }); const theme = { diff --git a/components/job-documents/job-documents-local.component.jsx b/components/job-documents/job-documents-local.component.jsx index dd23433..1641809 100644 --- a/components/job-documents/job-documents-local.component.jsx +++ b/components/job-documents/job-documents-local.component.jsx @@ -8,7 +8,7 @@ import { View, } from "react-native"; import MediaCacheOverlay from "../media-cache-overlay/media-cache-overlay.component"; -import * as Sentry from '@sentry/react-native'; +import * as Sentry from "@sentry/react-native"; import Toast from "react-native-toast-message"; import cleanAxios from "../../util/CleanAxios"; @@ -76,10 +76,7 @@ async function getPhotos({ bodyshop, jobid, setImages }) { if (localmediaserverhttp.endsWith("/")) { localmediaserverhttp = localmediaserverhttp.slice(0, -1); } - console.log( - "🚀 ~ file: job-documents-local.component.jsx ~ line 78 ~ localmediaserverhttp", - localmediaserverhttp - ); + try { const imagesFetch = await cleanAxios.post( `${localmediaserverhttp}/jobs/list`, diff --git a/components/upload-delete-switch/upload-delete-switch.component.jsx b/components/upload-delete-switch/upload-delete-switch.component.jsx index 0dc438e..3c2a4dc 100644 --- a/components/upload-delete-switch/upload-delete-switch.component.jsx +++ b/components/upload-delete-switch/upload-delete-switch.component.jsx @@ -1,11 +1,11 @@ -import React from 'react'; -import { useTranslation } from 'react-i18next'; -import { StyleSheet, Text, View } from 'react-native'; -import { Checkbox } from 'react-native-paper'; -import { connect } from 'react-redux'; -import { createStructuredSelector } from 'reselect'; -import { toggleDeleteAfterUpload } from '../../redux/app/app.actions'; -import { selectDeleteAfterUpload } from '../../redux/app/app.selectors'; +import React from "react"; +import { useTranslation } from "react-i18next"; +import { StyleSheet, Text, View } from "react-native"; +import { Checkbox } from "react-native-paper"; +import { connect } from "react-redux"; +import { createStructuredSelector } from "reselect"; +import { toggleDeleteAfterUpload } from "../../redux/app/app.actions"; +import { selectDeleteAfterUpload } from "../../redux/app/app.selectors"; const mapStateToProps = createStructuredSelector({ deleteAfterUpload: selectDeleteAfterUpload, @@ -20,12 +20,10 @@ export function UploadDeleteSwitch({ toggleDeleteAfterUpload, }) { const { t } = useTranslation(); - - console.log('🚀 ~ deleteAfterUpload:', deleteAfterUpload); return ( - {t('mediabrowser.labels.deleteafterupload')} + {t("mediabrowser.labels.deleteafterupload")} { toggleDeleteAfterUpload(); }} - status={deleteAfterUpload ? 'checked' : 'unchecked'} + status={deleteAfterUpload ? "checked" : "unchecked"} /> ); } const styles = StyleSheet.create({ container: { - display: 'flex', - flexDirection: 'row', - alignItems: 'center', + display: "flex", + flexDirection: "row", + alignItems: "center", margin: 10, }, diff --git a/util/document-upload.utility.js b/util/document-upload.utility.js index 02b2fb8..b8b2802 100644 --- a/util/document-upload.utility.js +++ b/util/document-upload.utility.js @@ -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); diff --git a/util/local-document-upload.utility.js b/util/local-document-upload.utility.js index eda4eab..36d724f 100644 --- a/util/local-document-upload.utility.js +++ b/util/local-document-upload.utility.js @@ -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 }); + } }, };