Skip to content

Commit

Permalink
Merge pull request #136 from tonywagner/master
Browse files Browse the repository at this point in the history
support cancelled plans before their expiration date
  • Loading branch information
m0ngr31 authored Jan 4, 2025
2 parents bbc9323 + ce00f82 commit 5ce19d3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions services/nfl-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export type TOtherAuth = 'prime' | 'tve' | 'peacock' | 'sunday_ticket';

interface INFLJwt {
dmaCode: string;
plans: {plan: string; status: string}[];
plans: {plan: string; status: string; expirationDate: string}[];
networks?: {[key: string]: string};
}

Expand Down Expand Up @@ -508,7 +508,7 @@ class NflHandler {

if (plans) {
const redZoneAccess =
plans.findIndex(p => p.plan === 'NFL_PLUS_PREMIUM' && p.status === 'ACTIVE') > -1 || networks?.NFLRZ
plans.findIndex(p => p.plan === 'NFL_PLUS_PREMIUM' && (p.status === 'ACTIVE' || (p.status === 'CANCELLED' && p.expirationDate >= (new Date()).toISOString().split('T')[0]))) > -1 || networks?.NFLRZ
? true
: false;

Expand Down Expand Up @@ -558,7 +558,7 @@ class NflHandler {

if (plans) {
hasPlus =
plans.findIndex(p => (p.plan === 'NFL_PLUS' || p.plan === 'NFL_PLUS_PREMIUM') && p.status === 'ACTIVE') > -1
plans.findIndex(p => (p.plan === 'NFL_PLUS' || p.plan === 'NFL_PLUS_PREMIUM') && (p.status === 'ACTIVE' || (p.status === 'CANCELLED' && p.expirationDate >= (new Date()).toISOString().split('T')[0]))) > -1
? true
: false;
}
Expand Down

0 comments on commit 5ce19d3

Please sign in to comment.