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

@@ -58,7 +58,6 @@ class WorkItemSceneAR extends React.Component {
@autobind
handleLoadEnd() {
this.arScene.getCameraOrientationAsync().then((orientation) => {
console.log(orientation)
return this.arScene
.performARHitTestWithRay(orientation.forward)
.then((results) => {

View File

@@ -235,7 +235,6 @@ export class Activity extends React.Component {
@autobind
handleUploadProgress(uploadData) {
console.log(uploadData)
if (this.state.progressModal) {
this.setState({
uploadPercent: Math.round(

View File

@@ -253,7 +253,6 @@ export class WorkItem extends React.Component {
@autobind
handleUploadProgress(uploadData) {
console.log(uploadData)
if (this.state.progressModal) {
this.setState({
uploadPercent: Math.round(

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()}