From 0aa92af0b2d83593684ab1a8c62548db44d44845 Mon Sep 17 00:00:00 2001
From: Nawfal Ahmed <111358247+NawfalAhmed@users.noreply.github.com>
Date: Thu, 15 Jun 2023 17:25:02 +0500
Subject: [PATCH] fix: fix edge-case for completed courses in a subscription
program (#32476)
---
.../learner_dashboard/program_details_tab_view.underscore | 6 +++++-
.../learner_dashboard/program_details_view.underscore | 6 +++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/lms/templates/learner_dashboard/program_details_tab_view.underscore b/lms/templates/learner_dashboard/program_details_tab_view.underscore
index 0a7e03904d..f15265119d 100644
--- a/lms/templates/learner_dashboard/program_details_tab_view.underscore
+++ b/lms/templates/learner_dashboard/program_details_tab_view.underscore
@@ -103,7 +103,11 @@
) %>
- <% } else if (is_learner_eligible_for_one_click_purchase && (typeof is_mobile_only === 'undefined' || is_mobile_only === false)) { %>
+ <% } else if (
+ !isSubscriptionEligible
+ && is_learner_eligible_for_one_click_purchase
+ && (typeof is_mobile_only === 'undefined' || is_mobile_only === false)
+ ) { %>
<%- gettext('Upgrade All Remaining Courses (')%>
<% if (discount_data.is_discounted) { %>
diff --git a/lms/templates/learner_dashboard/program_details_view.underscore b/lms/templates/learner_dashboard/program_details_view.underscore
index bff5093182..c2bdca897e 100644
--- a/lms/templates/learner_dashboard/program_details_view.underscore
+++ b/lms/templates/learner_dashboard/program_details_view.underscore
@@ -78,7 +78,11 @@
) %>
- <% } else if (is_learner_eligible_for_one_click_purchase && (typeof is_mobile_only === 'undefined' || is_mobile_only === false)) { %>
+ <% } else if (
+ !isSubscriptionEligible
+ && is_learner_eligible_for_one_click_purchase
+ && (typeof is_mobile_only === 'undefined' || is_mobile_only === false)
+ ) { %>
<%- gettext('Upgrade All Remaining Courses (')%>
<% if (discount_data.is_discounted) { %>