Pre release tweaks

This commit is contained in:
John Lyon-Smith
2018-05-14 18:50:08 -07:00
parent 82f2828441
commit 5d67cb69b0
6 changed files with 38 additions and 40 deletions

View File

@@ -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)
)

View File

@@ -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)