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 // // ... 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 = { const theme = {

View File

@@ -8,7 +8,7 @@ import {
View, View,
} from "react-native"; } from "react-native";
import MediaCacheOverlay from "../media-cache-overlay/media-cache-overlay.component"; 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 Toast from "react-native-toast-message";
import cleanAxios from "../../util/CleanAxios"; import cleanAxios from "../../util/CleanAxios";
@@ -76,10 +76,7 @@ async function getPhotos({ bodyshop, jobid, setImages }) {
if (localmediaserverhttp.endsWith("/")) { if (localmediaserverhttp.endsWith("/")) {
localmediaserverhttp = localmediaserverhttp.slice(0, -1); localmediaserverhttp = localmediaserverhttp.slice(0, -1);
} }
console.log(
"🚀 ~ file: job-documents-local.component.jsx ~ line 78 ~ localmediaserverhttp",
localmediaserverhttp
);
try { try {
const imagesFetch = await cleanAxios.post( const imagesFetch = await cleanAxios.post(
`${localmediaserverhttp}/jobs/list`, `${localmediaserverhttp}/jobs/list`,

View File

@@ -1,11 +1,11 @@
import React from 'react'; import React from "react";
import { useTranslation } from 'react-i18next'; import { useTranslation } from "react-i18next";
import { StyleSheet, Text, View } from 'react-native'; import { StyleSheet, Text, View } from "react-native";
import { Checkbox } from 'react-native-paper'; import { Checkbox } from "react-native-paper";
import { connect } from 'react-redux'; import { connect } from "react-redux";
import { createStructuredSelector } from 'reselect'; import { createStructuredSelector } from "reselect";
import { toggleDeleteAfterUpload } from '../../redux/app/app.actions'; import { toggleDeleteAfterUpload } from "../../redux/app/app.actions";
import { selectDeleteAfterUpload } from '../../redux/app/app.selectors'; import { selectDeleteAfterUpload } from "../../redux/app/app.selectors";
const mapStateToProps = createStructuredSelector({ const mapStateToProps = createStructuredSelector({
deleteAfterUpload: selectDeleteAfterUpload, deleteAfterUpload: selectDeleteAfterUpload,
@@ -20,12 +20,10 @@ export function UploadDeleteSwitch({
toggleDeleteAfterUpload, toggleDeleteAfterUpload,
}) { }) {
const { t } = useTranslation(); const { t } = useTranslation();
console.log('🚀 ~ deleteAfterUpload:', deleteAfterUpload);
return ( return (
<View style={styles.container}> <View style={styles.container}>
<Text style={styles.text}> <Text style={styles.text}>
{t('mediabrowser.labels.deleteafterupload')} {t("mediabrowser.labels.deleteafterupload")}
</Text> </Text>
<Checkbox <Checkbox
// trackColor={{ false: '#767577', true: '#81b0ff' }} // trackColor={{ false: '#767577', true: '#81b0ff' }}
@@ -34,16 +32,16 @@ export function UploadDeleteSwitch({
onPress={() => { onPress={() => {
toggleDeleteAfterUpload(); toggleDeleteAfterUpload();
}} }}
status={deleteAfterUpload ? 'checked' : 'unchecked'} status={deleteAfterUpload ? "checked" : "unchecked"}
/> />
</View> </View>
); );
} }
const styles = StyleSheet.create({ const styles = StyleSheet.create({
container: { container: {
display: 'flex', display: "flex",
flexDirection: 'row', flexDirection: "row",
alignItems: 'center', alignItems: "center",
margin: 10, margin: 10,
}, },

View File

@@ -135,7 +135,6 @@ export const uploadToImgproxy = async (
}, },
}; };
console.log("Uploading to S3", key, preSignedUploadUrlToS3, file, options);
const formData = new FormData(); const formData = new FormData();
formData.append("file", { formData.append("file", {
uri: imageData.localUri, uri: imageData.localUri,
@@ -149,8 +148,8 @@ export const uploadToImgproxy = async (
file, file,
options options
); );
debugger;
console.log(s3UploadResponse);
} catch (error) { } catch (error) {
console.log("Error uploading to S3", error.message, error.stack); console.log("Error uploading to S3", error.message, error.stack);
Sentry.Native.captureException(error); Sentry.Native.captureException(error);

View File

@@ -2,7 +2,7 @@ import axios from "axios";
import { store } from "../redux/store"; import { store } from "../redux/store";
import mime from "mime"; import mime from "mime";
import * as MediaLibrary from "expo-media-library"; 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( axios.interceptors.request.use(
function (config) { function (config) {
@@ -45,8 +45,9 @@ export const handleLocalUpload = async ({
ims_token: bodyshop.localmediatoken, ims_token: bodyshop.localmediatoken,
}, },
onUploadProgress: (e) => { onUploadProgress: (e) => {
if (onProgress) if (onProgress) {
onProgress({ percent: e.loaded / e.total, loaded: e.loaded }); onProgress({ percent: e.loaded / e.total, loaded: e.loaded });
}
}, },
}; };