Skip to content

Commit 2984200

Browse files
committed
fix(dashboard): correct date range for MAU
1 parent 7a9713e commit 2984200

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)