Added RNFS and refactor image upload to use it

This commit is contained in:
John Lyon-Smith
2018-05-14 10:38:38 -07:00
parent 6fae5ef5d6
commit eda43b0869
16 changed files with 174 additions and 109 deletions

View File

@@ -47,8 +47,6 @@ export class Home extends React.Component {
workItemDistance: -1,
}
this.watchId = null
if (Platform.OS !== "ios") {
ensurePermissions(
[
@@ -130,13 +128,6 @@ export class Home extends React.Component {
})
}
componentWillUnmount() {
if (this.watchId) {
navigator.geolocation.clearWatch(this.watchId)
this.watchId = null
}
}
@autobind
handleMessageDismiss() {
this.setState({ messageModal: null })
@@ -255,6 +246,17 @@ export class Home extends React.Component {
this.setState({ showWorkItems: !this.state.showWorkItems })
}
@autobind
handleCalloutPress(workItem) {
if (api.loggedInUser.administrator) {
this.props.history.push(
`/arviewer?workItemId=${workItem._id}&workItemType=${
workItem.workItemType
}`
)
}
}
render() {
const {
sections,
@@ -310,7 +312,7 @@ export class Home extends React.Component {
: hardhatPinImage
}
onPress={(e) => this.handleMarkerPress(e, index)}>
<Callout>
<Callout onPress={() => this.handleCalloutPress(workItem)}>
<View>
<Text>
{pad(workItem.ticketNumber, 4) +