Skip to content

Commit

Permalink
Updates the code behind the More Dates selector to work without the c…
Browse files Browse the repository at this point in the history
…ourse page (#1900)

Updates the code behind the More Dates selector to work without the course page
  • Loading branch information
jkachel committed Sep 18, 2023
1 parent 5e6f5ee commit 5845581
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions frontend/public/src/containers/ProductDetailEnrollApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,16 +405,12 @@ export class ProductDetailEnrollApp extends React.Component<
const csrfToken = getCookie("csrftoken")

let run =
!this.getCurrentCourseRun() && courseRuns
? courseRuns[0]
: this.getCurrentCourseRun() && courseRuns
? courseRuns[0].page && this.getCurrentCourseRun().page
? courseRuns[0].page.page_url ===
this.getCurrentCourseRun().page.page_url
? this.getCurrentCourseRun()
: courseRuns[0]
: courseRuns[0]
: null
!this.getCurrentCourseRun() && !courseRuns
? null
: !this.getCurrentCourseRun() && courseRuns
? courseRuns[0]
: this.getCurrentCourseRun()

if (run) this.updateDate(run)
let product = run && run.products ? run.products[0] : null
if (courseRuns) {
Expand Down

0 comments on commit 5845581

Please sign in to comment.