Skip to content

fix: admin dashboard user route not loading when premium features are disabled#2121

Merged
DonKoko merged 3 commits intomainfrom
fix-admin-dashboard-user-route-when-premium-is-disabled
Oct 16, 2025
Merged

fix: admin dashboard user route not loading when premium features are disabled#2121
DonKoko merged 3 commits intomainfrom
fix-admin-dashboard-user-route-when-premium-is-disabled

Conversation

@DonKoko
Copy link
Copy Markdown
Contributor

@DonKoko DonKoko commented Oct 16, 2025

There was a bug that caused the admin dashboard user page to error out when the ENABLE_PREMIUM_FEATURES env variable was set to false

… disabled

There was a bug that caused the admin dashboard user
page to error out when the ENABLE_PREMIUM_FEATURES env
variable was set to false
@DonKoko DonKoko requested a review from Copilot October 16, 2025 10:01
@vercel
Copy link
Copy Markdown

vercel bot commented Oct 16, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
shelf-docs Ignored Ignored Preview Oct 16, 2025 10:05am

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Fixes an error on the admin dashboard user page when premium features are disabled by short-circuiting Stripe lookups and conditionally rendering premium-only UI.

  • Add guard in Stripe utilities to return empty prices when premium is disabled
  • Make loader conditional on premium to avoid creating/fetching a Stripe customer
  • Pass premiumIsEnabled to the client and gate the "customerId" UI

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
app/utils/stripe.server.ts Adds a short-circuit in getStripePricesAndProducts to return empty results when premium features are disabled.
app/routes/_layout+/admin-dashboard+/$userId.tsx Conditionally fetches Stripe customer only if premium is enabled, includes premiumIsEnabled in loader data, and hides the customerId UI when premium is disabled.

Comment thread app/utils/stripe.server.ts Outdated
Comment thread app/utils/stripe.server.ts Outdated
Comment thread app/utils/stripe.server.ts Outdated
Comment thread app/routes/_layout+/admin-dashboard+/$userId.tsx
DonKoko and others added 2 commits October 16, 2025 12:05
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@DonKoko DonKoko merged commit b6e8a44 into main Oct 16, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants