only load ima when needed
This commit is contained in:
parent
224f10663d
commit
132d6ba50c
1 changed files with 11 additions and 9 deletions
|
@ -7,7 +7,7 @@ import classnames from 'classnames';
|
||||||
import analytics from 'analytics';
|
import analytics from 'analytics';
|
||||||
import { setSearchUserId } from 'redux/actions/search';
|
import { setSearchUserId } from 'redux/actions/search';
|
||||||
import { buildURI, parseURI } from 'util/lbryURI';
|
import { buildURI, parseURI } from 'util/lbryURI';
|
||||||
import { SIMPLE_SITE } from 'config';
|
import { SIMPLE_SITE, SHOW_ADS } from 'config';
|
||||||
import Router from 'component/router/index';
|
import Router from 'component/router/index';
|
||||||
import ModalRouter from 'modal/modalRouter';
|
import ModalRouter from 'modal/modalRouter';
|
||||||
import ReactModal from 'react-modal';
|
import ReactModal from 'react-modal';
|
||||||
|
@ -346,15 +346,17 @@ function App(props: Props) {
|
||||||
|
|
||||||
// Load IMA3 SDK for aniview
|
// Load IMA3 SDK for aniview
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const script = document.createElement('script');
|
if (!isAuthenticated && SHOW_ADS) {
|
||||||
script.src = imaLibraryPath;
|
const script = document.createElement('script');
|
||||||
script.async = true;
|
script.src = imaLibraryPath;
|
||||||
// $FlowFixMe
|
script.async = true;
|
||||||
document.body.appendChild(script);
|
|
||||||
return () => {
|
|
||||||
// $FlowFixMe
|
// $FlowFixMe
|
||||||
document.body.removeChild(script);
|
document.body.appendChild(script);
|
||||||
};
|
return () => {
|
||||||
|
// $FlowFixMe
|
||||||
|
document.body.removeChild(script);
|
||||||
|
};
|
||||||
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// add secure privacy script
|
// add secure privacy script
|
||||||
|
|
Loading…
Reference in a new issue