Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4979974

Browse files
committed
build fix
1 parent29c8767 commit4979974

File tree

4 files changed

+16
-14
lines changed

4 files changed

+16
-14
lines changed

‎packages/dashboard/src/app/(layout)/subscription/components/PlansComparison.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type Props = {
1818
exportdefaultfunctionPlansComparison({subscription, customerData}:Props){
1919

2020
const[billingCycle,setBillingCycle]=useState("monthly");
21-
const{paddle, error,handleUpgrade}=usePaddle();
21+
const{handleUpgrade}=usePaddle();
2222

2323

2424
// Toggle billing cycle

‎packages/dashboard/src/app/(layout)/subscription/components/SubscriptionCard.tsx‎

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
"use client";
22

3-
import{useState}from"react";
4-
import{Badge}from"@/components/ui/badge";
5-
import{Progress}from"@/components/ui/progress";
6-
import{Button}from"@/components/ui/button";
7-
import{Card,CardContent,CardDescription,CardHeader,CardTitle}from"@/components/ui/card";
3+
import{Badge}from"@/components/ui/badge";
4+
import{Progress}from"@/components/ui/progress";
5+
import{Button}from"@/components/ui/button";
6+
import{Card,CardContent,CardDescription,CardHeader,CardTitle}from"@/components/ui/card";
87
import{Tables}from"@/utils/supabase/database.types";
98
import{PLANS}from"@/utils/constants";
109
import{format}from"date-fns";
11-
import{pro_monthly_id,pro_yearly_id,usePaddle}from"@/hooks/usePaddle";
10+
import{pro_monthly_id,usePaddle}from"@/hooks/usePaddle";
1211

1312
typeProps={
1413
subscription:(Tables<'subscriptions'>&Tables<'customers'>)|null;
@@ -18,8 +17,8 @@ type Props = {
1817
}
1918
}
2019

21-
exportdefaultfunctionSubscriptionCard({subscription, usages, customerData}:Props){
22-
const{paddle,error,handleUpgrade}=usePaddle();
20+
exportdefaultfunctionSubscriptionCard({subscription, usages, customerData}:Props){
21+
const{paddle, handleUpgrade}=usePaddle();
2322

2423
constisPro=subscription?.subscription_status==="active";
2524
constmaxRequestsPerMonth=isPro ?PLANS.PRO.REQUESTS_PER_MONTH :PLANS.BASIC.REQUESTS_PER_MONTH
@@ -30,7 +29,7 @@ export default function SubscriptionCard({ subscription, usages, customerData }:
3029
consthandleCancel=async()=>{
3130
try{
3231
paddle?.Retain.initCancellationFlow({
33-
subscriptionId:subscription?.subscription_id!,
32+
subscriptionId:subscription?.subscription_idasstring,
3433
})
3534
}catch(error){
3635
console.error("Error canceling subscription:",error);
@@ -74,7 +73,7 @@ export default function SubscriptionCard({ subscription, usages, customerData }:
7473
{usages} /{maxRequestsPerMonth}
7574
</div>
7675
</div>
77-
<Progressvalue={usagePercentage}className="h-2"/>
76+
<Progressvalue={usagePercentage}className="h-2"/>
7877
</CardContent>
7978
</Card>
8079
);

‎packages/dashboard/src/app/(layout)/subscription/page.tsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { getSubscription } from "@/utils/paddle/getSubscription";
77
exportdefaultasyncfunctionSubscriptionPage(){
88
constsupabase=awaitcreateClient()
99
const{data:{user}}=awaitsupabase.auth.getUser()
10-
const{ data}=awaitsupabase.from('usages').select().eq('user_id',user?.id!).maybeSingle()
10+
const{ data}=awaitsupabase.from('usages').select().eq('user_id',user?.idasstring).maybeSingle()
1111
constusages=data?.calls_count
1212
constsubscription=awaitgetSubscription()
1313

@@ -24,14 +24,14 @@ export default async function SubscriptionPage() {
2424
<div>
2525
<h2className="text-xl font-semibold mb-4">Current Subscription</h2>
2626
<SubscriptionCardusages={usages}subscription={subscription}customerData={{
27-
email:user?.email!,
27+
email:user?.emailasstring,
2828
}}/>
2929
</div>
3030

3131
<div>
3232
<h2className="text-xl font-semibold mb-4">Plans Comparison</h2>
3333
<PlansComparisonsubscription={subscription}customerData={{
34-
email:user?.email!,
34+
email:user?.emailasstring,
3535
}}/>
3636
</div>
3737
</div>

‎packages/dashboard/src/hooks/usePaddle.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import{env}from"next-runtime-env";
22
import{useCallback,useEffect,useState}from"react";
33
import{initializePaddle,Paddle}from"@paddle/paddle-js";
4+
import{captureException}from"@sentry/nextjs"
45

56

67
constenvironment=env('NEXT_PUBLIC_PADDLE_ENV')as"sandbox";
@@ -24,6 +25,7 @@ export function usePaddle() {
2425
}
2526
})
2627
.catch((err)=>{
28+
captureException(err);
2729
if(isMounted){
2830
setError(errasError);
2931
console.error('Failed to initialize Paddle:',err);
@@ -61,6 +63,7 @@ export function usePaddle() {
6163
}
6264
})
6365
}catch(error){
66+
captureException(error);
6467
console.error("Error upgrading subscription:",error);
6568
}
6669
};

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp