Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
add is_license_expired and current_period_end into consts
Browse files Browse the repository at this point in the history
  • Loading branch information
juliosgarbi committed Feb 29, 2024
1 parent 871c976 commit 46c0f27
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/DataManager/Toolbar/instruments.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,16 @@ const style = {
justifyContent: 'space-between',
};

// Check if user is on trial
const isTrialExpired = window.APP_SETTINGS.billing.checks.is_license_expired;
// Check the subscription period end date
const subscriptionPeriodEnd = window.APP_SETTINGS.subscription.current_period_end;
// Check if user is self-serve
const isSelfServe = isFF(FF_SELF_SERVE) && window.APP_SETTINGS.billing.enterprise;
// Check if user is self-serve and has expired trial
const isSelfServeExpiredTrial = isSelfServe && window.APP_SETTINGS.billing.checks.is_license_expired && !window.APP_SETTINGS.subscription.current_period_end;
const isSelfServeExpiredTrial = isSelfServe && isTrialExpired && !subscriptionPeriodEnd;
// Check if user is self-serve and has expired subscription
const isSelfServeExpiredSubscription = isSelfServe && window.APP_SETTINGS.subscription.current_period_end && new Date(window.APP_SETTINGS.subscription.current_period_end) < new Date();
const isSelfServeExpiredSubscription = isSelfServe && subscriptionPeriodEnd && new Date(subscriptionPeriodEnd) < new Date();
// Check if user is self-serve and has expired trial or subscription
const isSelfServeExpired = isSelfServeExpiredTrial || isSelfServeExpiredSubscription;

Expand Down

0 comments on commit 46c0f27

Please sign in to comment.