Remove code that is never reached
If the limit is reached, window.mailpoet_display_detailed_stats is false [MAILPOET-5938]
This commit is contained in:
committed by
Aschepikov
parent
3fa4930da3
commit
c3e12f8aff
@@ -1,7 +1,6 @@
|
|||||||
import { __ } from '@wordpress/i18n';
|
import { __ } from '@wordpress/i18n';
|
||||||
import { MailPoet } from 'mailpoet';
|
import { MailPoet } from 'mailpoet';
|
||||||
import { Button } from 'common/button/button';
|
import { Button } from 'common/button/button';
|
||||||
import { PremiumRequired } from 'common/premium-required/premium-required';
|
|
||||||
import { withBoundary } from '../../common';
|
import { withBoundary } from '../../common';
|
||||||
import { PremiumBannerWithUpgrade } from '../../common/premium-banner-with-upgrade/premium-banner-with-upgrade';
|
import { PremiumBannerWithUpgrade } from '../../common/premium-banner-with-upgrade/premium-banner-with-upgrade';
|
||||||
|
|
||||||
@@ -49,44 +48,6 @@ function PremiumBanner() {
|
|||||||
if (!window.mailpoet_display_detailed_stats) {
|
if (!window.mailpoet_display_detailed_stats) {
|
||||||
return <SkipDisplayingDetailedStats />;
|
return <SkipDisplayingDetailedStats />;
|
||||||
}
|
}
|
||||||
if (window.mailpoet_subscribers_limit_reached) {
|
|
||||||
const hasValidApiKey = window.mailpoet_has_valid_api_key;
|
|
||||||
const title = __('Upgrade required', 'mailpoet');
|
|
||||||
const youReachedTheLimit = hasValidApiKey
|
|
||||||
? __(
|
|
||||||
'Congratulations, you now have [subscribersCount] subscribers! Your plan is limited to [subscribersLimit] subscribers. You need to upgrade now to be able to continue using MailPoet.',
|
|
||||||
'mailpoet',
|
|
||||||
)
|
|
||||||
: __(
|
|
||||||
'Congratulations, you now have [subscribersCount] subscribers! Our free version is limited to [subscribersLimit] subscribers. You need to upgrade now to be able to continue using MailPoet.',
|
|
||||||
'mailpoet',
|
|
||||||
)
|
|
||||||
.replace('[subscribersLimit]', MailPoet.subscribersLimit.toString())
|
|
||||||
.replace('[subscribersCount]', MailPoet.subscribersCount.toString());
|
|
||||||
const upgradeLink = hasValidApiKey
|
|
||||||
? MailPoet.MailPoetComUrlFactory.getUpgradeUrl(MailPoet.pluginPartialKey)
|
|
||||||
: MailPoet.MailPoetComUrlFactory.getPurchasePlanUrl(
|
|
||||||
window.mailpoet_subscribers_count + 1,
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="mailpoet-stats-premium-required">
|
|
||||||
<PremiumRequired
|
|
||||||
title={title}
|
|
||||||
message={<p>{youReachedTheLimit}</p>}
|
|
||||||
actionButton={
|
|
||||||
<Button
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer"
|
|
||||||
href={upgradeLink}
|
|
||||||
>
|
|
||||||
{__('Upgrade Now', 'mailpoet')}
|
|
||||||
</Button>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user