Pre release tweaks
This commit is contained in:
@@ -34,7 +34,7 @@ export class BoundInput extends React.Component {
|
||||
|
||||
@autobind
|
||||
handleChangeText(newText) {
|
||||
if (this.props.binder) {
|
||||
if (this && this.props && this.props.binder) {
|
||||
this.setState(
|
||||
this.props.binder.updateFieldValue(this.props.name, newText)
|
||||
)
|
||||
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
} from "react-native"
|
||||
import { Icon } from "."
|
||||
import ImagePicker from "react-native-image-picker"
|
||||
import ImageResizer from "react-native-image-resizer"
|
||||
import autobind from "autobind-decorator"
|
||||
import { api } from "../API"
|
||||
|
||||
@@ -48,7 +49,7 @@ export class BoundPhotoPanel extends Component {
|
||||
|
||||
@autobind
|
||||
handlePhotoPress(index) {
|
||||
const { onUploadStarted, onUploadEnded } = this.props
|
||||
const { onUploadStarted, onUploadEnded, onUploadProgress } = this.props
|
||||
|
||||
ImagePicker.showImagePicker(
|
||||
{
|
||||
@@ -67,11 +68,10 @@ export class BoundPhotoPanel extends Component {
|
||||
|
||||
const uri = response.path || response.uri
|
||||
|
||||
createResizedImage(uri, 800, 600, "JPEG", 80)
|
||||
.then((newUri) => {
|
||||
return
|
||||
api.upload(newUri, this.props.onUploadProgress)
|
||||
})
|
||||
ImageResizer.createResizedImage(uri, 1024, 1024, "JPEG", 80)
|
||||
.then((result) =>
|
||||
api.upload(result.path || result.uri, onUploadProgress)
|
||||
)
|
||||
.then((uploadData) => {
|
||||
if (onUploadEnded) {
|
||||
onUploadEnded(true, uploadData)
|
||||
|
||||
Reference in New Issue
Block a user