Skip to content

Commit 9c1b8e8

Browse files
committed
fix(editor): fixes re-initialization of editor when snapshot imported
fixes #119
1 parent 89ecc70 commit 9c1b8e8

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

lib/editor/components/EditorHelpModal.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,12 @@ export default class EditorHelpModal extends Component {
2828
loadFeedVersionForEditing({feedSourceId, feedVersionId})
2929
}
3030

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

@@ -55,8 +59,7 @@ export default class EditorHelpModal extends Component {
5559
show={this.state.showModal}
5660
onHide={this.close}
5761
// Prevent closure of modal if there is no snapshot yet
58-
backdrop={isNewFeed ? 'static' : undefined}
59-
>
62+
backdrop={isNewFeed ? 'static' : undefined}>
6063
<Header closeButton={!isNewFeed}>
6164
<Title>Welcome to the GTFS Editor</Title>
6265
</Header>
@@ -75,7 +78,7 @@ export default class EditorHelpModal extends Component {
7578
bsStyle='primary'
7679
bsSize='large'
7780
block
78-
onClick={this._onClickReload} >
81+
onClick={this._onClickBeginEditing} >
7982
<Icon type='check' /> Begin editing
8083
</Button>
8184
: <ButtonToolbar>
@@ -102,7 +105,7 @@ export default class EditorHelpModal extends Component {
102105
href={`${getConfigProperty('application.docs_url')}/en/latest/user/editor/introduction/`} >
103106
documentation
104107
</a>.
105-
</p>
108+
</p>
106109
}
107110
{/* <Carousel>
108111
<Item>

0 commit comments

Comments
 (0)