Update env. vars and remove logs.

This commit is contained in:
Patrick Fic
2021-05-20 16:14:35 -07:00
parent 5647a52ef0
commit 130dac3921
4 changed files with 18 additions and 26 deletions

View File

@@ -8,12 +8,12 @@
"ios": { "ios": {
"supportsTablet": true, "supportsTablet": true,
"bundleIdentifier": "com.imex.imexmobile", "bundleIdentifier": "com.imex.imexmobile",
"buildNumber": "1.0.12", "buildNumber": "1.0.12-1",
"googleServicesFile": "./GoogleService-Info.plist" "googleServicesFile": "./GoogleService-Info.plist"
}, },
"android": { "android": {
"package": "com.imex.imexmobile", "package": "com.imex.imexmobile",
"versionCode": 12, "versionCode": 1001201,
"googleServicesFile": "./google-services.json" "googleServicesFile": "./google-services.json"
}, },
"splash": { "splash": {

View File

@@ -52,7 +52,6 @@ export function ImageBrowserScreen({
const client = useApolloClient(); const client = useApolloClient();
async function handleOnSuccess(uri, id) { async function handleOnSuccess(uri, id) {
console.log("Succesful upload!", uri);
logImEXEvent("imexmobile_successful_upload"); logImEXEvent("imexmobile_successful_upload");
setUploads((prevUploads) => _.omit(prevUploads, uri)); setUploads((prevUploads) => _.omit(prevUploads, uri));
} }
@@ -77,17 +76,17 @@ export function ImageBrowserScreen({
return (await acc) + info.size; return (await acc) + info.size;
}, 0); }, 0);
console.log( // console.log(
"Size of uploaded documents.", // "Size of uploaded documents.",
queryData.data.documents_aggregate.aggregate.sum.size, // queryData.data.documents_aggregate.aggregate.sum.size,
"Shop Limit", // "Shop Limit",
bodyshop.jobsizelimit, // bodyshop.jobsizelimit,
"Space remaining", // "Space remaining",
bodyshop.jobsizelimit - // bodyshop.jobsizelimit -
queryData.data.documents_aggregate.aggregate.sum.size, // queryData.data.documents_aggregate.aggregate.sum.size,
"Total of uploaded files", // "Total of uploaded files",
totalOfUploads // totalOfUploads
); // );
if ( if (
bodyshop.jobsizelimit - bodyshop.jobsizelimit -
@@ -108,7 +107,7 @@ export function ImageBrowserScreen({
let filename; let filename;
//Appears to work for android. //Appears to work for android.
//iOS provides the filename, android doe snot. //iOS provides the filename, android doe snot.
console.log("pid", p.id);
filename = p.filename || p.uri.split("/").pop(); filename = p.filename || p.uri.split("/").pop();
const result = await handleUpload( const result = await handleUpload(
{ {
@@ -133,10 +132,7 @@ export function ImageBrowserScreen({
if (deleteAfterUpload) { if (deleteAfterUpload) {
try { try {
const result = await MediaLibrary.deleteAssetsAsync( await MediaLibrary.deleteAssetsAsync(ret.map((r) => r.mediaId));
ret.map((r) => r.mediaId)
);
console.log("Delete result :>> ", result);
} catch (error) { } catch (error) {
console.log("Unable to delete picture.", error); console.log("Unable to delete picture.", error);
} }

1
env.js
View File

@@ -45,7 +45,6 @@ function getEnvVars() {
let env = process.env.NODE_ENV; let env = process.env.NODE_ENV;
if (env === null || env === undefined || env === "") return ENV.dev; if (env === null || env === undefined || env === "") return ENV.dev;
if (env.indexOf("dev") !== -1) return ENV.dev; if (env.indexOf("dev") !== -1) return ENV.dev;
if (env.indexOf("staging") !== -1) return ENV.staging;
if (env.indexOf("prod") !== -1) return ENV.prod; if (env.indexOf("prod") !== -1) return ENV.prod;
else return ENV.prod; else return ENV.prod;
} }

View File

@@ -57,7 +57,7 @@ export const uploadToCloudinary = async (
tagsArray ? tagsArray.map((tag) => `${tag},`) : "" tagsArray ? tagsArray.map((tag) => `${tag},`) : ""
}`; }`;
// let eager = process.env.REACT_APP_CLOUDINARY_THUMB_TRANSFORMATIONS; // let eager = process.env.REACT_APP_CLOUDINARY_THUMB_TRANSFORMATIONS;
console.log("fileType", fileType);
const upload_preset = fileType.startsWith("video") const upload_preset = fileType.startsWith("video")
? "incoming_upload_video" ? "incoming_upload_video"
: "incoming_upload"; : "incoming_upload";
@@ -134,12 +134,9 @@ export const uploadToCloudinary = async (
if (onError) onError(cloudinaryUploadResponse.statusText); if (onError) onError(cloudinaryUploadResponse.statusText);
return { success: false, error: cloudinaryUploadResponse.statusText }; return { success: false, error: cloudinaryUploadResponse.statusText };
} }
console.log("mediaId", mediaId);
const imageData = await MediaLibrary.getAssetInfoAsync(mediaId); const imageData = await MediaLibrary.getAssetInfoAsync(mediaId);
console.log(
"🚀 ~ file: document-upload.utility.js ~ line 140 ~ imageData",
imageData.creationTime
);
//Insert the document with the matching key. //Insert the document with the matching key.
const documentInsert = await client.mutate({ const documentInsert = await client.mutate({
mutation: INSERT_NEW_DOCUMENT, mutation: INSERT_NEW_DOCUMENT,