Skip to content

Commit

Permalink
Correctly check location for GDPR production script (#3019)
Browse files Browse the repository at this point in the history
  • Loading branch information
tzarebczan authored Nov 7, 2023
1 parent e632171 commit e97c8e8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ui/component/app/view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ type Props = {
theme: string,
user: ?{ id: string, has_verified_email: boolean, is_reward_approved: boolean },
locale: ?LocaleInfo,
location: { pathname: string, hash: string, search: string, hostname: string, reload: () => void },
location: { pathname: string, hash: string, search: string, reload: () => void },
history: { push: (string) => void, location: { pathname: string }, replace: (string) => void },
signIn: () => void,
setLanguage: (string) => void,
Expand Down Expand Up @@ -148,7 +148,7 @@ function App(props: Props) {
const [lbryTvApiStatus, setLbryTvApiStatus] = useState(STATUS_OK);
const [sidebarOpen] = usePersistedState('sidebar', false);

const { pathname, hash, search, hostname } = location;
const { pathname, hash, search } = location;
const [retryingSync, setRetryingSync] = useState(false);
const [langRenderKey, setLangRenderKey] = useState(0);
const [seenSunsestMessage, setSeenSunsetMessage] = usePersistedState('lbrytv-sunset', false);
Expand Down Expand Up @@ -409,7 +409,7 @@ function App(props: Props) {
return;
}

const useProductionOneTrust = process.env.NODE_ENV === 'production' && hostname === 'odysee.com';
const useProductionOneTrust = process.env.NODE_ENV === 'production' && window?.location?.hostname === 'odysee.com';

const script = document.createElement('script');
script.src = oneTrustScriptSrc;
Expand Down

0 comments on commit e97c8e8

Please sign in to comment.