Added RNFS and refactor image upload to use it
This commit is contained in:
@@ -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) +
|
||||
|
||||
Reference in New Issue
Block a user