Added RNFS and refactor image upload to use it

This commit is contained in:
John Lyon-Smith
2018-05-14 10:38:38 -07:00
parent 6fae5ef5d6
commit eda43b0869
16 changed files with 174 additions and 109 deletions

View File

@@ -53,9 +53,10 @@ export class BoundPhotoPanel extends Component {
ImagePicker.showImagePicker(
{
title: "Select Photo",
noData: true,
storageOptions: {
skipBackup: true,
path: "photos",
path: "deighton",
},
},
(response) => {
@@ -64,7 +65,7 @@ export class BoundPhotoPanel extends Component {
onUploadStarted()
}
api
.upload(response.data, this.props.onUploadProgress)
.upload(response.path, this.props.onUploadProgress)
.then((uploadData) => {
if (onUploadEnded) {
onUploadEnded(true, uploadData)
@@ -74,7 +75,7 @@ export class BoundPhotoPanel extends Component {
if (binder) {
const value = binder.getFieldValue(name)
let newValue = value.slice(0)
let newValue = typeof value === "array" ? value.slice(0) : []
newValue[index] = uploadData.assetId