Skip to content

Commit be916b2

Browse files
committed
disables ads
1 parent 8570c20 commit be916b2

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

src/components/common/PostCardGrid.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ function PostCardGrid({ posts, loading, forHome, forPost }: PostCardGridProps) {
2828
}, []);
2929

3030
const postsWithAds = useMemo(() => {
31+
if (1 === 1) return posts; // disable adsense
3132
if (user) return posts; // hide ads to users
3233
if (adBlocked) return posts;
3334
if (!forHome) return posts;

src/containers/post/PostViewer.tsx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -404,13 +404,14 @@ const PostViewer: React.FC<PostViewerProps> = ({
404404
<RelatedPostsForGuest
405405
postId={post.id}
406406
showAds={
407-
!isVeryOld &&
408-
Date.now() - new Date(post.released_at).getTime() >
409-
1000 * 60 * 60 * 24 * 21
407+
false
408+
// !isVeryOld &&
409+
// Date.now() - new Date(post.released_at).getTime() >
410+
// 1000 * 60 * 60 * 24 * 21
410411
}
411412
/>
412413
)}
413-
{isVeryOld && userId === null && <HorizontalAd />}
414+
{/* {isVeryOld && userId === null && <HorizontalAd />} */}
414415
<PostComments
415416
count={post.comments_count}
416417
comments={post.comments}
@@ -421,10 +422,11 @@ const PostViewer: React.FC<PostViewerProps> = ({
421422
<RelatedPost
422423
postId={post.id}
423424
showAds={
424-
!isVeryOld &&
425-
post.user.id !== userId &&
426-
Date.now() - new Date(post.released_at).getTime() >
427-
1000 * 60 * 60 * 24 * 30
425+
false
426+
// !isVeryOld &&
427+
// post.user.id !== userId &&
428+
// Date.now() - new Date(post.released_at).getTime() >
429+
// 1000 * 60 * 60 * 24 * 30
428430
}
429431
/>
430432
)}

src/server/Html.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ function Html({
6767
/>
6868
))}
6969
<meta name="viewport" content="width=device-width, initial-scale=1" />
70-
<script
70+
{/* <script
7171
data-ad-client="ca-pub-5574866530496701"
7272
async
7373
src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"
74-
></script>
74+
></script> */}
7575
<script
7676
async
7777
src="https://www.googletagmanager.com/gtag/js?id=UA-125599395-1"

0 commit comments

Comments
 (0)