Skip to content

Commit

Permalink
Changed old logic for pulling the current conference
Browse files Browse the repository at this point in the history
Session had old code for conference selection. That was coded out
but the old selection code was left behind.
  • Loading branch information
Stardog committed Sep 21, 2020
1 parent 27f5abf commit 97c0827
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions javascript/Session/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,18 +210,15 @@ export default class Session extends Listing {
},
]
this.state.currentConference = {}
this.state.currentConferenceKey = 0

this.locations = []
this.conferences = []
this.state.resource = Object.assign({}, this.defaultResource)
this.setCurrentConference = this.setCurrentConference.bind(this)
this.activeButton = this.activeButton.bind(this)
}

componentDidMount() {
loadLocations(this)
this.loadConferences()
this.loadConference()
super.componentDidMount()
}

Expand Down Expand Up @@ -293,30 +290,20 @@ export default class Session extends Listing {
super.load({conferenceId: this.props.conferenceId})
}

loadConferences() {
loadConference() {
$.ajax({
url: 'conference/Admin/Conference',
url: 'conference/Admin/Conference/' + this.props.conferenceId,
dataType: 'json',
type: 'get',
success: (data) => {
this.conferences = data.listing
this.setState({currentConference: data.listing[0]})
this.setState({currentConference: data})
},
error: () => {
this.setMessage('Could not access server')
},
})
}

setCurrentConference(e) {
const currentConferenceKey = e.target.value
const currentConference = Object.assign(
{},
this.conferences[currentConferenceKey]
)
this.setState({currentConferenceKey, currentConference})
}

form() {
return (
<SessionForm
Expand Down

0 comments on commit 97c0827

Please sign in to comment.