Skip to content

Commit

Permalink
fix(manager): change confirmUpload to arrow func to fix uploading feed
Browse files Browse the repository at this point in the history
fixes #25
  • Loading branch information
landonreed committed Sep 21, 2017
1 parent becbe92 commit 3b39c98
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions lib/manager/components/FeedSourceDropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default class FeedSourceDropdown extends Component {
case 'fetch':
return this.props.fetchFeed(this.props.feedSource)
case 'upload':
return this.uploadFeed()
return this._uploadFeed()
case 'deploy':
return this.props.createDeploymentFromFeedSource(this.props.feedSource)
case 'public':
Expand All @@ -38,20 +38,20 @@ export default class FeedSourceDropdown extends Component {

deleteFeed () {
this.props.setHold(this.props.feedSource)
this.refs['deleteModal'].open()
// this.setState({keepActive: true})
this.refs.deleteModal.open()
}

uploadFeed () {
_uploadFeed () {
this.props.setHold(this.props.feedSource)
this.refs['uploadModal'].open()
this.refs.uploadModal.open()
}

confirmUpload (files) {
confirmUpload = (files) => {
const {feedSource, setHold, uploadFeed} = this.props
const file = files[0]
if (isValidZipFile(file)) {
this.props.uploadFeed(this.props.feedSource, file)
this.props.setHold(false)
uploadFeed(feedSource, file)
setHold(false)
return true
} else {
return false
Expand All @@ -65,6 +65,7 @@ export default class FeedSourceDropdown extends Component {
_onDelete = () => this.props.deleteFeedSource(this.props.feedSource)

render () {
console.log(this.props)
const {
feedSource,
project,
Expand All @@ -75,7 +76,8 @@ export default class FeedSourceDropdown extends Component {
const editGtfsDisabled = !user.permissions.hasFeedPermission(project.organizationId, project.id, feedSource.id, 'edit-gtfs')

return <div>
<ConfirmModal ref='deleteModal'
<ConfirmModal
ref='deleteModal'
title='Delete Feed Source?'
body={`Are you sure you want to delete the feed source ${feedSource.name}?`}
onConfirm={this._onDelete}
Expand Down

0 comments on commit 3b39c98

Please sign in to comment.