Fix bug when adding multiple photos. Added RN image resizer

This commit is contained in:
John Lyon-Smith
2018-05-14 11:09:07 -07:00
parent eda43b0869
commit fdd5f67d90
12 changed files with 30 additions and 14 deletions

View File

@@ -65,7 +65,7 @@ export class BoundPhotoPanel extends Component {
onUploadStarted()
}
api
.upload(response.path, this.props.onUploadProgress)
.upload(response.path || response.uri, this.props.onUploadProgress)
.then((uploadData) => {
if (onUploadEnded) {
onUploadEnded(true, uploadData)
@@ -75,7 +75,7 @@ export class BoundPhotoPanel extends Component {
if (binder) {
const value = binder.getFieldValue(name)
let newValue = typeof value === "array" ? value.slice(0) : []
let newValue = value instanceof Array ? value.slice(0) : []
newValue[index] = uploadData.assetId
@@ -110,10 +110,6 @@ export class BoundPhotoPanel extends Component {
const renderPhoto = (index) => {
const assetId = assetIds[index]
if (assetId) {
console.log(api.makeImageUrl(assetId))
}
return (
<TouchableOpacity
key={assetId || "blank" + index.toString()}