Skip to content

Commit

Permalink
Remove temporal pro tier handling
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubno committed May 14, 2024
1 parent 97d50e3 commit c470cc3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion apps/docs/src/app/pricing/SwitchToProButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function SwitchTierButton() {
</Button>
)}

{(user.pricingTier.id === tiers.pro.id && !user.teams[0].team_billing[0].credit_card_added) && (
{(user.pricingTier.id === tiers.pro.id) && (
<Button
onClick={createCheckoutSession}
>
Expand Down
5 changes: 1 addition & 4 deletions apps/docs/src/utils/useUser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ type Team = {
tier: string
is_default: boolean
email: string
team_billing: {
credit_card_added: boolean
}[]
}

type UserContextType = {
Expand Down Expand Up @@ -104,7 +101,7 @@ export const CustomUserContextProvider = (props) => {
// @ts-ignore
const { data: userTeams, teamsError } = await supabase
.from('users_teams')
.select('teams (id, name, is_default, tier, email, team_billing (credit_card_added))')
.select('teams (id, name, is_default, tier, email)')
.eq('user_id', session?.user.id) // Due to RLS, we could also safely just fetch all, but let's be explicit for sure

if (teamsError) Sentry.captureException(teamsError)
Expand Down

0 comments on commit c470cc3

Please sign in to comment.