Minor cleanup.

This commit is contained in:
Patrick Fic
2025-02-28 10:15:34 -08:00
parent 023de62244
commit ca93c0900c
5 changed files with 22 additions and 27 deletions

2
App.js
View File

@@ -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 = {

View File

@@ -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`,

View File

@@ -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 (
<View style={styles.container}>
<Text style={styles.text}>
{t('mediabrowser.labels.deleteafterupload')}
{t("mediabrowser.labels.deleteafterupload")}
</Text>
<Checkbox
// trackColor={{ false: '#767577', true: '#81b0ff' }}
@@ -34,16 +32,16 @@ export function UploadDeleteSwitch({
onPress={() => {
toggleDeleteAfterUpload();
}}
status={deleteAfterUpload ? 'checked' : 'unchecked'}
status={deleteAfterUpload ? "checked" : "unchecked"}
/>
</View>
);
}
const styles = StyleSheet.create({
container: {
display: 'flex',
flexDirection: 'row',
alignItems: 'center',
display: "flex",
flexDirection: "row",
alignItems: "center",
margin: 10,
},

View File

@@ -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);

View File

@@ -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 });
}
},
};