Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:supabase/supabase
- Loading branch information
Showing
4 changed files
with
39 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,39 @@ | ||
import { AppProps } from 'next/app' | ||
import { useRouter } from 'next/router' | ||
import { useEffect } from 'react' | ||
import '../styles/index.css' | ||
import { post } from './../lib/fetchWrapper' | ||
|
||
export default function MyApp({ Component, pageProps }: AppProps) { | ||
const router = useRouter() | ||
|
||
function telemetry() { | ||
return post(`https://app.supabase.io/api/telemetry/page`, { | ||
referrer: document.referrer, | ||
title: document.title, | ||
}) | ||
} | ||
|
||
useEffect(() => { | ||
// `routeChangeComplete` won't run for the first page load unless the query string is | ||
// hydrated later on, so here we log a page view if this is the first render and | ||
// there's no query string | ||
if (!router.asPath.includes('?')) { | ||
telemetry() | ||
} | ||
}, []) | ||
|
||
useEffect(() => { | ||
function handleRouteChange() { | ||
telemetry() | ||
} | ||
|
||
// Listen for page changes after a navigation or when the query changes | ||
router.events.on('routeChangeComplete', handleRouteChange) | ||
return () => { | ||
router.events.off('routeChangeComplete', handleRouteChange) | ||
} | ||
}, [router.events]) | ||
|
||
return <Component {...pageProps} /> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c9751d5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
main – ./
main.supabase.vercel.app
main-psi.vercel.app
main-git-master.supabase.vercel.app
beta.supabase.io
supabase.io
c9751d5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
docs – ./web
docs-rose.vercel.app
docs.supabase.vercel.app
docs-git-master.supabase.vercel.app
c9751d5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
www – ./www
www-git-master.supabase.vercel.app
www-alpha.vercel.app
www.supabase.vercel.app