Remove country check

Per Tom, this was just a temporary thing due to vidcrunch.
This commit is contained in:
infinite-persistence 2022-05-19 23:09:24 +08:00
parent 3557e72419
commit 8303856a06
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0

View file

@ -2,16 +2,22 @@
import React from 'react';
import { SHOW_ADS } from 'config';
const NO_COUNTRY_CHECK = true;
const GOOGLE_AD_URL = 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js';
let ad_blocker_detected;
export default function useShouldShowAds(hasPremiumPlus: boolean, userCountry: string, doSetAdBlockerFound: (boolean) => void) {
export default function useShouldShowAds(
hasPremiumPlus: boolean,
userCountry: string,
doSetAdBlockerFound: (boolean) => void
) {
const [shouldShowAds, setShouldShowAds] = React.useState(resolveAdVisibility());
function resolveAdVisibility() {
// 'ad_blocker_detected' will be undefined at startup. Wait until we are
// sure it is not blocked (i.e. === false) before showing the component.
return ad_blocker_detected === false && SHOW_ADS && !hasPremiumPlus && userCountry === 'US';
return ad_blocker_detected === false && SHOW_ADS && !hasPremiumPlus && (NO_COUNTRY_CHECK || userCountry === 'US');
}
React.useEffect(() => {