Skip to content

Commit

Permalink
fix(editor): clear editor state on component mount
Browse files Browse the repository at this point in the history
  • Loading branch information
landonreed committed Feb 22, 2018
1 parent 83519b2 commit d021eac
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/editor/components/GtfsEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ export default class GtfsEditor extends Component {
}

componentWillMount () {
// Wipe any leftover state that may exist for other feed sources in editor.
// NOTE: Clear GTFS content happens outside of onComponentMount function so
// that it is only ever called on mount (onComponentMount is called after
// a successful snapshot/import when starting from scratch).
this.props.clearGtfsContent()
this.props.onComponentMount(this.props)
}

Expand Down

0 comments on commit d021eac

Please sign in to comment.