Fix bug when adding multiple photos. Added RN image resizer
This commit is contained in:
@@ -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()}
|
||||
|
||||
Reference in New Issue
Block a user