Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Skip the environment banner when no workspace environment is loaded.

Kiran Kaf91f7388bf0
diff --git a/apps/web/lib/hooks/use-dashboard-banner-visible.ts b/apps/web/lib/hooks/use-dashboard-banner-visible.ts
index f79e104589..9f2d48a10f 100644
--- a/apps/web/lib/hooks/use-dashboard-banner-visible.ts
+++ b/apps/web/lib/hooks/use-dashboard-banner-visible.ts
@@ -27,9 +27,10 @@ export function useDashboardBannerVisible() {
isProductionEnvironment(environment) &&
!loading;
- // Visible in non-production workspaces
+ // Visible in non-production workspaces. A missing environment (account
+ // settings, or a failed workspace fetch) is not a staging/sandbox workspace.
const isEnvironmentBannerVisible =
- !isProductionEnvironment(environment) && !loading;
+ Boolean(environment) && !isProductionEnvironment(environment) && !loading;
const hasBanner = isUpgradeBannerVisible || isEnvironmentBannerVisible;