Commit a95697da authored by Zach Pomerantz's avatar Zach Pomerantz Committed by GitHub

fix: initialize analytics outside of react lifecycle (#5173)

parent 08357440
...@@ -49,6 +49,7 @@ const Asset = lazy(() => import('nft/pages/asset/Asset')) ...@@ -49,6 +49,7 @@ const Asset = lazy(() => import('nft/pages/asset/Asset'))
// Placeholder API key. Actual API key used in the proxy server // Placeholder API key. Actual API key used in the proxy server
const ANALYTICS_DUMMY_KEY = '00000000000000000000000000000000' const ANALYTICS_DUMMY_KEY = '00000000000000000000000000000000'
const ANALYTICS_PROXY_URL = process.env.REACT_APP_AMPLITUDE_PROXY_URL const ANALYTICS_PROXY_URL = process.env.REACT_APP_AMPLITUDE_PROXY_URL
initializeAnalytics(ANALYTICS_DUMMY_KEY, OriginApplication.INTERFACE, ANALYTICS_PROXY_URL)
const AppWrapper = styled.div` const AppWrapper = styled.div`
display: flex; display: flex;
...@@ -126,7 +127,6 @@ export default function App() { ...@@ -126,7 +127,6 @@ export default function App() {
const [scrolledState, setScrolledState] = useState(false) const [scrolledState, setScrolledState] = useState(false)
useAnalyticsReporter() useAnalyticsReporter()
initializeAnalytics(ANALYTICS_DUMMY_KEY, OriginApplication.INTERFACE, ANALYTICS_PROXY_URL)
const scrollListener = (e: Event) => { const scrollListener = (e: Event) => {
if (window.scrollY > 0) { if (window.scrollY > 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment