Capture Photo Info & Change Env Dynamically.

This commit is contained in:
Patrick Fic
2021-05-20 09:36:16 -07:00
parent 48514e72a5
commit 5647a52ef0
10 changed files with 62 additions and 87 deletions

View File

@@ -1,14 +1,17 @@
import { useApolloClient } from "@apollo/client";
import { Ionicons } from "@expo/vector-icons";
//const limit = plimit(2);
import * as FileSystem from "expo-file-system";
import { AssetsSelector } from "expo-images-picker";
import * as MediaLibrary from "expo-media-library";
import _ from "lodash";
import React, { useCallback, useState } from "react";
import { useTranslation } from "react-i18next";
import { StyleSheet, Text, View, Alert } from "react-native";
import { Alert, StyleSheet, Text, View } from "react-native";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { logImEXEvent } from "../../firebase/firebase.analytics";
import { GET_DOC_SIZE_TOTALS } from "../../graphql/documents.queries";
import {
selectCurrentCameraJobId,
selectDeleteAfterUpload,
@@ -21,9 +24,6 @@ import { handleUpload } from "../../util/document-upload.utility";
import CameraSelectJob from "../camera-select-job/camera-select-job.component";
import UploadDeleteSwitch from "../upload-delete-switch/upload-delete-switch.component";
import UploadProgress from "../upload-progress/upload-progress.component";
import { GET_DOC_SIZE_TOTALS } from "../../graphql/documents.queries";
//const limit = plimit(2);
import * as FileSystem from "expo-file-system";
const mapStateToProps = createStructuredSelector({
currentUser: selectCurrentUser,
@@ -76,7 +76,7 @@ export function ImageBrowserScreen({
const info = await FileSystem.getInfoAsync(val.uri, { size: true });
return (await acc) + info.size;
}, 0);
console.log("data :>> ", data);
console.log(
"Size of uploaded documents.",
queryData.data.documents_aggregate.aggregate.sum.size,
@@ -108,6 +108,7 @@ export function ImageBrowserScreen({
let filename;
//Appears to work for android.
//iOS provides the filename, android doe snot.
console.log("pid", p.id);
filename = p.filename || p.uri.split("/").pop();
const result = await handleUpload(
{