File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
app/team/[team_slug]/[project_slug]/connect/in-app-wallets
components/embedded-wallets/Analytics Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 11import type { Range } from "components/analytics/date-range-selector" ;
22import { InAppWalletAnalytics } from "components/embedded-wallets/Analytics" ;
3+ import { notFound } from "next/navigation" ;
4+ import { getProject } from "../../../../../../@/api/projects" ;
5+ import { getAPIKeyForProjectId } from "../../../../../api/lib/getAPIKeys" ;
36
47export default async function Page ( props : {
58 params : Promise < { team_slug : string ; project_slug : string } > ;
@@ -27,9 +30,19 @@ export default async function Page(props: {
2730 ? ( searchParams . interval as "day" | "week" )
2831 : "week" ;
2932
33+ const project = await getProject ( params . team_slug , params . project_slug ) ;
34+ if ( ! project ) {
35+ notFound ( ) ;
36+ }
37+
38+ const apiKey = await getAPIKeyForProjectId ( project . id ) ;
39+ if ( ! apiKey ) {
40+ notFound ( ) ;
41+ }
42+
3043 return (
3144 < InAppWalletAnalytics
32- clientId = { params . project_slug }
45+ clientId = { apiKey . key }
3346 interval = { interval }
3447 range = { range as Range }
3548 />
Original file line number Diff line number Diff line change @@ -20,7 +20,10 @@ export async function InAppWalletAnalytics({
2020 from : range . from ,
2121 to : range . to ,
2222 period : interval ,
23- } ) . catch ( ( ) => null ) ;
23+ } ) . catch ( ( error ) => {
24+ console . error ( error ) ;
25+ return [ ] ;
26+ } ) ;
2427
2528 return (
2629 < div >
You can’t perform that action at this time.
0 commit comments