Remove country check
Per Tom, this was just a temporary thing due to vidcrunch.
This commit is contained in:
parent
3557e72419
commit
8303856a06
1 changed files with 8 additions and 2 deletions
|
@ -2,16 +2,22 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { SHOW_ADS } from 'config';
|
import { SHOW_ADS } from 'config';
|
||||||
|
|
||||||
|
const NO_COUNTRY_CHECK = true;
|
||||||
|
|
||||||
const GOOGLE_AD_URL = 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js';
|
const GOOGLE_AD_URL = 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js';
|
||||||
let ad_blocker_detected;
|
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());
|
const [shouldShowAds, setShouldShowAds] = React.useState(resolveAdVisibility());
|
||||||
|
|
||||||
function resolveAdVisibility() {
|
function resolveAdVisibility() {
|
||||||
// 'ad_blocker_detected' will be undefined at startup. Wait until we are
|
// 'ad_blocker_detected' will be undefined at startup. Wait until we are
|
||||||
// sure it is not blocked (i.e. === false) before showing the component.
|
// 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(() => {
|
React.useEffect(() => {
|
||||||
|
|
Loading…
Reference in a new issue