File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ type AggregatedMetrics = {
1414
1515export function ProjectHighlightsCard ( props : {
1616 selectedChart : string | undefined ;
17+ aggregatedUserStats : InAppWalletStats [ ] ;
1718 userStats : InAppWalletStats [ ] ;
1819 volumeStats : UniversalBridgeStats [ ] ;
1920 teamSlug : string ;
@@ -22,6 +23,7 @@ export function ProjectHighlightsCard(props: {
2223} ) {
2324 const {
2425 selectedChart,
26+ aggregatedUserStats,
2527 userStats,
2628 volumeStats,
2729 teamSlug,
@@ -70,6 +72,12 @@ export function ProjectHighlightsCard(props: {
7072 : "activeUsers"
7173 }
7274 aggregateFn = { ( _data , key ) => {
75+ if ( key === "activeUsers" ) {
76+ return aggregatedUserStats . reduce (
77+ ( acc , curr ) => acc + curr . uniqueWalletsConnected ,
78+ 0 ,
79+ ) ;
80+ }
7381 return timeSeriesData . reduce ( ( acc , curr ) => acc + curr [ key ] , 0 ) ;
7482 } }
7583 chartConfig = { chartConfig }
Original file line number Diff line number Diff line change @@ -378,8 +378,18 @@ async function AsyncAppHighlightsCard(props: {
378378 params : PageParams ;
379379 authToken : string ;
380380} ) {
381- const [ walletUserStatsTimeSeries , universalBridgeUsage ] =
381+ const [ aggregatedUserStats , walletUserStatsTimeSeries , universalBridgeUsage ] =
382382 await Promise . allSettled ( [
383+ getInAppWalletUsage (
384+ {
385+ from : props . range . from ,
386+ period : "all" ,
387+ projectId : props . project . id ,
388+ teamId : props . project . teamId ,
389+ to : props . range . to ,
390+ } ,
391+ props . authToken ,
392+ ) ,
383393 getInAppWalletUsage (
384394 {
385395 from : props . range . from ,
@@ -408,6 +418,11 @@ async function AsyncAppHighlightsCard(props: {
408418 ) {
409419 return (
410420 < ProjectHighlightsCard
421+ aggregatedUserStats = {
422+ aggregatedUserStats . status === "fulfilled"
423+ ? aggregatedUserStats . value
424+ : [ ]
425+ }
411426 selectedChart = { props . selectedChart }
412427 selectedChartQueryParam = { props . selectedChartQueryParam }
413428 teamSlug = { props . params . team_slug }
You can’t perform that action at this time.
0 commit comments