@@ -17,7 +17,7 @@ import {
17
17
SetPlanBody ,
18
18
SubscriptionResult ,
19
19
} from "@trigger.dev/platform/v3" ;
20
- import React , { useState } from "react" ;
20
+ import React , { useEffect , useState } from "react" ;
21
21
import { inspect } from "util" ;
22
22
import { z } from "zod" ;
23
23
import { DefinitionTip } from "~/components/DefinitionTooltip" ;
@@ -322,6 +322,10 @@ export function TierFree({
322
322
const [ isLackingFeaturesChecked , setIsLackingFeaturesChecked ] = useState ( false ) ;
323
323
const status = subscription ?. freeTierStatus ?? "requires_connect" ;
324
324
325
+ useEffect ( ( ) => {
326
+ setIsDialogOpen ( false ) ;
327
+ } , [ subscription ] ) ;
328
+
325
329
return (
326
330
< TierContainer >
327
331
< div className = "relative" >
@@ -395,7 +399,7 @@ export function TierFree({
395
399
< input type = "hidden" name = "type" value = "free" />
396
400
< input type = "hidden" name = "callerPath" value = { location . pathname } />
397
401
< DialogHeader > Downgrade plan</ DialogHeader >
398
- < div className = "flex items-start gap-3 pb-6 pr-4 pt-6 " >
402
+ < div className = "flex items-start gap-3 pb-6 pr-4 pt-8 " >
399
403
< ArrowDownCircleIcon className = "size-12 min-w-12 text-error" />
400
404
< Paragraph variant = "base/bright" className = "text-text-bright" >
401
405
Are you sure you want to downgrade? If you do, you will retain your current
@@ -519,6 +523,10 @@ export function TierHobby({
519
523
const isLoading = navigation . formAction === formAction ;
520
524
const [ isDialogOpen , setIsDialogOpen ] = useState ( false ) ;
521
525
526
+ useEffect ( ( ) => {
527
+ setIsDialogOpen ( false ) ;
528
+ } , [ subscription ] ) ;
529
+
522
530
return (
523
531
< TierContainer isHighlighted = { isHighlighted } >
524
532
< PricingHeader title = { plan . title } isHighlighted = { isHighlighted } cost = { plan . tierPrice } />
@@ -546,7 +554,7 @@ export function TierHobby({
546
554
< ArrowDownCircleIcon className = "size-12 text-blue-500" />
547
555
</ span >
548
556
< Paragraph variant = "base/bright" className = "text-text-bright" >
549
- By downgrading you will lose access to your current plan’ s features and your
557
+ By downgrading you will lose access to your current plan' s features and your
550
558
included credits will be reduced.
551
559
</ Paragraph >
552
560
</ div >
0 commit comments