Skip to content

Commit

Permalink
feat: handle edge cases for purchased courses in a subscription progr…
Browse files Browse the repository at this point in the history
…am (#32438)
  • Loading branch information
NawfalAhmed authored Jun 14, 2023
1 parent 4bd032a commit 5204ee6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ class ProgramDetailsView extends Backbone.View {
));
const programPurchasedWithoutSubscription = (
this.subscriptionModel.get('subscriptionState') !== 'active'
&& this.subscriptionModel.get('subscriptionState') !== 'inactive'
&& !isSomeCoursePurchasable
&& this.remainingCourseCollection.length === 0
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@
</div>
</div>
<% } %>
<% if (isSubscriptionEligible) { %>
<% if (isSubscriptionEligible && (
completedCount !== totalCount
|| subscriptionState === 'active'
)
) { %>
<div class="d-flex flex-column align-items-start flex-xl-row align-items-xl-center upgrade-subscription">
<a
href="<%- subscriptionUrl %>"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
</div>
</div>
<% } %>
<% if (isSubscriptionEligible) { %>
<% if (isSubscriptionEligible && (
completedCount !== totalCount
|| subscriptionState === 'active'
)
) { %>
<div class="d-flex flex-column align-items-start flex-xl-row align-items-xl-center upgrade-subscription">
<a
href="<%- subscriptionUrl %>"
Expand Down

0 comments on commit 5204ee6

Please sign in to comment.