Skip to content

Commit 3566dc1

Browse files
committed
Fix condition for preview
1 parent ca8513c commit 3566dc1

File tree

1 file changed

+3
-4
lines changed
  • packages/gitbook/src/components/Ads

1 file changed

+3
-4
lines changed

packages/gitbook/src/components/Ads/Ad.tsx

+3-4
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,12 @@ export function Ad({
7474
let cancelled = false;
7575

7676
const previewParam = new URL(window.location.href).searchParams.get('ads_preview');
77-
const preview = !!previewParam && previewParam !== 'placeholder';
77+
const preview = !!previewParam;
7878
const realZoneId = preview ? PREVIEW_ZONE_ID : zoneId;
7979
const showPlaceholderAd =
8080
previewParam === 'placeholder' ||
8181
(siteAdsStatus &&
82-
(siteAdsStatus === SiteAdsStatus.Pending ||
83-
siteAdsStatus === SiteAdsStatus.InReview));
82+
(siteAdsStatus === SiteAdsStatus.Pending || siteAdsStatus === SiteAdsStatus.InReview))
8483

8584
if (!realZoneId) {
8685
return;
@@ -92,7 +91,7 @@ export function Ad({
9291
ignore: ignore || preview,
9392
zoneId: realZoneId,
9493
mode,
95-
source: showPlaceholderAd ? 'placeholder' : 'live',
94+
source: showPlaceholderAd ? 'placeholder' : 'live'
9695
});
9796

9897
if (cancelled) {

0 commit comments

Comments
 (0)