Code Cleanup & Minor Bug Fixes
This commit is contained in:
@@ -3,6 +3,7 @@ import { AssetsSelector } from "expo-images-picker";
|
||||
import * as MediaLibrary from "expo-media-library";
|
||||
import _ from "lodash";
|
||||
import { H3 } from "native-base";
|
||||
import plimit from "p-limit";
|
||||
import React, { useCallback, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { StyleSheet, Text, View } from "react-native";
|
||||
@@ -20,7 +21,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 plimit from "p-limit";
|
||||
|
||||
const limit = plimit(2);
|
||||
|
||||
@@ -31,7 +31,6 @@ const mapStateToProps = createStructuredSelector({
|
||||
deleteAfterUpload: selectDeleteAfterUpload,
|
||||
});
|
||||
|
||||
export default connect(mapStateToProps, null)(ImageBrowserScreen);
|
||||
export function ImageBrowserScreen({
|
||||
currentUser,
|
||||
bodyshop,
|
||||
@@ -49,6 +48,7 @@ export function ImageBrowserScreen({
|
||||
const forceRerender = useCallback(() => {
|
||||
setTick((tick) => tick + 1);
|
||||
}, []);
|
||||
|
||||
async function handleOnSuccess(uri, id) {
|
||||
console.log("Succesful upload!", uri);
|
||||
if (deleteAfterUpload) {
|
||||
@@ -70,9 +70,6 @@ export function ImageBrowserScreen({
|
||||
//Appears to work for android.
|
||||
//iOS provides the filename, android doe snot.
|
||||
filename = p.filename || p.uri.split("/").pop();
|
||||
|
||||
//File name for ios
|
||||
|
||||
actions.push(
|
||||
limit(
|
||||
handleUpload(
|
||||
@@ -130,7 +127,7 @@ export function ImageBrowserScreen({
|
||||
//maxSelections: 5,
|
||||
margin: 3,
|
||||
portraitCols: 4,
|
||||
landscapeCols: 5,
|
||||
landscapeCols: 6,
|
||||
widgetWidth: 100,
|
||||
widgetBgColor: "white",
|
||||
selectedBgColor: "#adadad",
|
||||
@@ -209,3 +206,5 @@ const styles = StyleSheet.create({
|
||||
function handleOnError(...props) {
|
||||
console.log("HandleOnError", props);
|
||||
}
|
||||
|
||||
export default connect(mapStateToProps, null)(ImageBrowserScreen);
|
||||
|
||||
Reference in New Issue
Block a user