Skip to content

Commit

Permalink
fix(editor): fixes re-initialization of editor when snapshot imported
Browse files Browse the repository at this point in the history
fixes #119
  • Loading branch information
landonreed committed May 7, 2018
1 parent 89ecc70 commit 9c1b8e8
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions lib/editor/components/EditorHelpModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@ export default class EditorHelpModal extends Component {
loadFeedVersionForEditing({feedSourceId, feedVersionId})
}

_onClickReload = () => {
this.props.onComponentMount({})
_onClickBeginEditing = () => {
const {onComponentMount} = this.props
// To begin editing, the GtfsEditor on mount function is called in order to
// fetch the base GTFS and perform any other initialization activities (e.g.
// to create an exclusive lock to edit the feed).
onComponentMount(this.props)
this.close()
}

Expand All @@ -55,8 +59,7 @@ export default class EditorHelpModal extends Component {
show={this.state.showModal}
onHide={this.close}
// Prevent closure of modal if there is no snapshot yet
backdrop={isNewFeed ? 'static' : undefined}
>
backdrop={isNewFeed ? 'static' : undefined}>
<Header closeButton={!isNewFeed}>
<Title>Welcome to the GTFS Editor</Title>
</Header>
Expand All @@ -75,7 +78,7 @@ export default class EditorHelpModal extends Component {
bsStyle='primary'
bsSize='large'
block
onClick={this._onClickReload} >
onClick={this._onClickBeginEditing} >
<Icon type='check' /> Begin editing
</Button>
: <ButtonToolbar>
Expand All @@ -102,7 +105,7 @@ export default class EditorHelpModal extends Component {
href={`${getConfigProperty('application.docs_url')}/en/latest/user/editor/introduction/`} >
documentation
</a>.
</p>
</p>
}
{/* <Carousel>
<Item>
Expand Down

0 comments on commit 9c1b8e8

Please sign in to comment.