diff --git a/src/components/app/hooks/useSubscriptionPlan.ts b/src/components/app/hooks/useSubscriptionPlan.ts
index 16d4b9c80..ef9985708 100644
--- a/src/components/app/hooks/useSubscriptionPlan.ts
+++ b/src/components/app/hooks/useSubscriptionPlan.ts
@@ -1,7 +1,7 @@
import { useCallback, useEffect, useState } from 'react';
import { Subscription, SubscriptionPlan } from '@/application/types';
-import { isOfficialHost } from '@/utils/subscription';
+import { isAppFlowyHosted } from '@/utils/subscription';
/**
* Hook to manage subscription plan loading and Pro feature detection
@@ -18,7 +18,7 @@ export function useSubscriptionPlan(
} {
const [activeSubscriptionPlan, setActiveSubscriptionPlan] = useState
(null);
// Pro features are enabled by default on self-hosted instances
- const isPro = activeSubscriptionPlan === SubscriptionPlan.Pro || !isOfficialHost();
+ const isPro = activeSubscriptionPlan === SubscriptionPlan.Pro || !isAppFlowyHosted();
const loadSubscription = useCallback(async () => {
try {
@@ -57,7 +57,7 @@ export function useSubscriptionPlan(
useEffect(() => {
// Only load subscription for official host (self-hosted instances have Pro features enabled by default)
- if (isOfficialHost()) {
+ if (isAppFlowyHosted()) {
void loadSubscription();
}
}, [loadSubscription]);
diff --git a/src/components/app/landing-pages/ApproveRequestPage.tsx b/src/components/app/landing-pages/ApproveRequestPage.tsx
index 17e81fb9a..e20c31196 100644
--- a/src/components/app/landing-pages/ApproveRequestPage.tsx
+++ b/src/components/app/landing-pages/ApproveRequestPage.tsx
@@ -19,7 +19,7 @@ import { NormalModal } from '@/components/_shared/modal';
import { useService } from '@/components/main/app.hooks';
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';
import { cn } from '@/lib/utils';
-import { isOfficialHost } from '@/utils/subscription';
+import { isAppFlowyHosted } from '@/utils/subscription';
const GuestLimitExceededCode = 1070;
const REPEAT_REQUEST_CODE = 1122;
@@ -54,7 +54,7 @@ function ApproveRequestPage() {
const plans = await service.getActiveSubscription(requestInfo.workspace.id);
setCurrentPlans(plans);
- if (plans.length === 0 && isOfficialHost()) {
+ if (plans.length === 0 && isAppFlowyHosted()) {
setUpgradeModalOpen(true);
}
// eslint-disable-next-line
@@ -84,7 +84,7 @@ function ApproveRequestPage() {
// eslint-disable-next-line
} catch (e: any) {
if (e.code === GuestLimitExceededCode) {
- if (isOfficialHost()) {
+ if (isAppFlowyHosted()) {
setUpgradeModalOpen(true);
}
@@ -112,7 +112,7 @@ function ApproveRequestPage() {
}
// This should not be called on self-hosted instances, but adding check as safety
- if (!isOfficialHost()) {
+ if (!isAppFlowyHosted()) {
// Self-hosted instances have Pro features enabled by default
return;
}
diff --git a/src/components/app/publish-manage/HomePageSetting.tsx b/src/components/app/publish-manage/HomePageSetting.tsx
index f7fb3e7ff..ff5302451 100644
--- a/src/components/app/publish-manage/HomePageSetting.tsx
+++ b/src/components/app/publish-manage/HomePageSetting.tsx
@@ -9,7 +9,7 @@ import { ReactComponent as SearchIcon } from '@/assets/icons/search.svg';
import { ReactComponent as UpgradeIcon } from '@/assets/icons/upgrade.svg';
import { Popover } from '@/components/_shared/popover';
import PageIcon from '@/components/_shared/view-icon/PageIcon';
-import { isOfficialHost } from '@/utils/subscription';
+import { isAppFlowyHosted } from '@/utils/subscription';
interface HomePageSettingProps {
onRemoveHomePage: () => Promise;
@@ -18,6 +18,7 @@ interface HomePageSettingProps {
publishViews: View[];
isOwner: boolean;
activePlan: SubscriptionPlan | null;
+ canEdit?: boolean;
}
function HomePageSetting({
@@ -27,6 +28,7 @@ function HomePageSetting({
homePage,
publishViews,
isOwner,
+ canEdit = true,
}: HomePageSettingProps) {
const [removeLoading, setRemoveLoading] = React.useState(false);
const [updateLoading, setUpdateLoading] = React.useState(false);
@@ -48,9 +50,14 @@ function HomePageSetting({
});
}, [setSearch, isOwner]);
+ // Don't show homepage setting when namespace is not editable (e.g., UUID namespace)
+ if (!canEdit) {
+ return null;
+ }
+
if (activePlan && activePlan !== SubscriptionPlan.Pro) {
// Only show upgrade button on official hosts (self-hosted instances have Pro features enabled by default)
- if (!isOfficialHost()) {
+ if (!isAppFlowyHosted()) {
return null;
}
@@ -62,6 +69,7 @@ function HomePageSetting({
size={'small'}
onClick={handleUpgrade}
endIcon={}
+ data-testid="homepage-upgrade-button"
>
{t('subscribe.changePlan')}
@@ -70,7 +78,7 @@ function HomePageSetting({
}
return (
-
+