From 5845581120c0bf7cc45d551bd59e8d4e89f85725 Mon Sep 17 00:00:00 2001 From: James Kachel Date: Mon, 18 Sep 2023 14:44:52 -0500 Subject: [PATCH] Updates the code behind the More Dates selector to work without the course page (#1900) Updates the code behind the More Dates selector to work without the course page --- .../src/containers/ProductDetailEnrollApp.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/frontend/public/src/containers/ProductDetailEnrollApp.js b/frontend/public/src/containers/ProductDetailEnrollApp.js index 788d4f88f5..937f060935 100644 --- a/frontend/public/src/containers/ProductDetailEnrollApp.js +++ b/frontend/public/src/containers/ProductDetailEnrollApp.js @@ -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) {