Skip to content

Commit 7d36418

Browse files
committed
[Dashboard] Fix: MAU date range (#5271)
Fixes CNCT-2185 <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on updating the date range for fetching in-app wallet usage statistics from the start of the current month to the last 30 days, improving the relevance of the data displayed. ### Detailed summary - In `layout.tsx`: - Changed `from` date in `getInAppWalletUsage` from the start of the current month to 30 days ago using `subDays`. - In `header.tsx`: - Updated `from` date in `getInAppWalletUsage` similarly to 30 days ago with `subDays`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 412fb5d commit 7d36418

File tree

2 files changed

+4
-2
lines changed
  • apps/dashboard/src/app
    • (dashboard)/dashboard/connect/in-app-wallets/[clientId]
    • team/[team_slug]/[project_slug]/connect/in-app-wallets/_components

2 files changed

+4
-2
lines changed

apps/dashboard/src/app/(dashboard)/dashboard/connect/in-app-wallets/[clientId]/layout.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { InAppWalletsSummary } from "components/embedded-wallets/Analytics/Summary";
22
import { getInAppWalletUsage } from "data/analytics/wallets/in-app";
3+
import { subDays } from "date-fns";
34
import { redirect } from "next/navigation";
45
import { getAuthToken } from "../../../../../api/lib/getAuthToken";
56
import { InAppWaletFooterSection } from "../../../../../team/[team_slug]/[project_slug]/connect/in-app-wallets/_components/footer";
@@ -42,7 +43,7 @@ export default async function Page(props: {
4243

4344
const monthlyStatsPromise = getInAppWalletUsage({
4445
clientId,
45-
from: new Date(new Date().getFullYear(), new Date().getMonth(), 1),
46+
from: subDays(new Date(), 30),
4647
to: new Date(),
4748
period: "month",
4849
});

apps/dashboard/src/app/team/[team_slug]/[project_slug]/connect/in-app-wallets/_components/header.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { TrackedLinkTW } from "@/components/ui/tracked-link";
22
import { InAppWalletsSummary } from "components/embedded-wallets/Analytics/Summary";
33
import { getInAppWalletUsage } from "data/analytics/wallets/in-app";
4+
import { subDays } from "date-fns";
45
import { TRACKING_CATEGORY } from "../_constants";
56

67
export async function InAppWalletsHeader({ clientId }: { clientId: string }) {
@@ -13,7 +14,7 @@ export async function InAppWalletsHeader({ clientId }: { clientId: string }) {
1314

1415
const monthlyStatsPromise = getInAppWalletUsage({
1516
clientId,
16-
from: new Date(new Date().getFullYear(), new Date().getMonth(), 1),
17+
from: subDays(new Date(), 30),
1718
to: new Date(),
1819
period: "month",
1920
});

0 commit comments

Comments
 (0)