From a6e10e55cc46f214b743e419205eb8a73ffe17b3 Mon Sep 17 00:00:00 2001 From: Owen Date: Mon, 13 Apr 2026 12:08:30 -0700 Subject: [PATCH] Handle grandfather on the front end --- server/routers/user/getUser.ts | 3 ++- src/components/DomainPicker.tsx | 14 +++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/server/routers/user/getUser.ts b/server/routers/user/getUser.ts index c2e43e16e..9ff52fd2d 100644 --- a/server/routers/user/getUser.ts +++ b/server/routers/user/getUser.ts @@ -21,7 +21,8 @@ async function queryUser(userId: string) { serverAdmin: users.serverAdmin, idpName: idp.name, idpId: users.idpId, - locale: users.locale + locale: users.locale, + dateCreated: users.dateCreated }) .from(users) .leftJoin(idp, eq(users.idpId, idp.idpId)) diff --git a/src/components/DomainPicker.tsx b/src/components/DomainPicker.tsx index e1ec1062e..ac8493d6e 100644 --- a/src/components/DomainPicker.tsx +++ b/src/components/DomainPicker.tsx @@ -49,6 +49,7 @@ import { usePaidStatus } from "@/hooks/usePaidStatus"; import { TierFeature, tierMatrix } from "@server/lib/billing/tierMatrix"; import { toUnicode } from "punycode"; import { useCallback, useEffect, useMemo, useState } from "react"; +import { useUserContext } from "@app/hooks/useUserContext"; type AvailableOption = { domainNamespaceId: string; @@ -97,10 +98,16 @@ export default function DomainPicker({ warnOnProvidedDomain = false }: DomainPickerProps) { const { env } = useEnvContext(); + const { user } = useUserContext(); const api = createApiClient({ env }); const t = useTranslations(); const { hasSaasSubscription } = usePaidStatus(); + const requiresPaywall = + build === "saas" && + !hasSaasSubscription(tierMatrix[TierFeature.DomainNamespaces]) && + new Date(user.dateCreated) > new Date("2026-04-13"); + const { data = [], isLoading: loadingDomains } = useQuery( orgQueries.domains({ orgId }) ); @@ -656,6 +663,7 @@ export default function DomainPicker({ }) } className="mx-2 rounded-md" + disabled={requiresPaywall} >
@@ -696,11 +704,7 @@ export default function DomainPicker({
- {build === "saas" && - !hasSaasSubscription( - tierMatrix[TierFeature.DomainNamespaces] - ) && - !hideFreeDomain && ( + {requiresPaywall && !hideFreeDomain && (