Was allowing existing work item location to be updated

This commit is contained in:
John Lyon-Smith
2018-06-04 09:28:03 -07:00
parent 8d70c39dfa
commit 4ebb4341b7

View File

@@ -221,8 +221,9 @@ export class WorkItem extends React.Component {
} }
handleRegionChange(region) { handleRegionChange(region) {
if (!this.isMapReady) { if (this.state.binder._id || !this.isMapReady) {
// On iOS we get this after setting the initial region, before the map declared as ready! // On iOS we get this after setting the initial region, before the map declared as ready!
// Also, if we are only viewing the work item, then don't allow region changes
return return
} }
@@ -428,7 +429,9 @@ export class WorkItem extends React.Component {
)} )}
{isIphoneX ? <View style={{ height: 30, width: "100%" }} /> : null} {isIphoneX ? <View style={{ height: 30, width: "100%" }} /> : null}
</ScrollView> </ScrollView>
<Geolocation onUpdate={this.handlePositionUpdate} watch={false} /> {!this.state.binder._id && (
<Geolocation onUpdate={this.handlePositionUpdate} watch={false} />
)}
<ProgressModal <ProgressModal
open={!!progressModal} open={!!progressModal}
message={progressModal ? progressModal.message : ""} message={progressModal ? progressModal.message : ""}